To facilitate writing julian code, we have overloaded a number of methods from Base. These methods should remove the need to interact with the grid field directly, and also allow to set and get values using the geographic coordinates (as opposed to the grid positions).

## From Base

Base.copyFunction
Base.copy(l::T) where {T <: SimpleSDMLayer}

Returns a new copy of the layer, which has the same type.

source
Base.collectFunction
Base.collect(l::T) where {T <: SimpleSDMLayer}

Returns the non-nothing values of a layer.

source
Base.eltypeFunction
Base.eltype(layer::SimpleSDMLayer{T}) where {T}

Returns the type of the values stored in the grid, where the Nothing type is omitted.

source
Base.sizeFunction
Base.size(layer::T) where {T <: SimpleSDMLayer}

Returns the size of the grid.

source
Base.size(layer::T, i...) where {T <: SimpleSDMLayer}

Returns the size of the grid alongside a dimension.

source
Base.strideFunction
Base.stride(layer::T; dims::Union{Nothing,Integer}=nothing) where {T <: SimpleSDMLayer}

Returns the stride, i.e. half the length, of cell dimensions, possibly alongside a side of the grid. The first position is the length of the longitude cells, the second the latitude.

source
Base.similarFunction
Base.similar(layer::T, ::Type{TC}) where {TC <: Any, T <: SimpleSDMLayer}

Returns a SimpleSDMResponse of the same dimensions as the original layer, with nothing in the same positions. The rest of the values are replaced by the output of zero(TC), which implies that there must be a way to get a zero for the type. If not, the same result can always be achieved through the use of copy, manual update, and convert.

source
Base.similar(layer::T) where {T <: SimpleSDMLayer}

Returns a SimpleSDMResponse of the same dimensions as the original layer, with nothing in the same positions. The rest of the values are replaced by the output of zero(element_type), which implies that there must be a way to get a zero for the type. If not, the same result can always be achieved through the use of copy, manual update, and convert.

source
Base.sumFunction
Base.sum(l::SimpleSDMResponse{T}) where {T <: Number}

Applies sum (from Base) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.sum(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies sum (from Base) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.maximumFunction
Base.maximum(l::SimpleSDMResponse{T}) where {T <: Number}

Applies maximum (from Base) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.maximum(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies maximum (from Base) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.minimumFunction
Base.minimum(l::SimpleSDMResponse{T}) where {T <: Number}

Applies minimum (from Base) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.minimum(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies minimum (from Base) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.extremaFunction
Base.extrema(l::SimpleSDMResponse{T}) where {T <: Number}

Applies extrema (from Base) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.extrema(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies extrema (from Base) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Base.maxFunction
Base.max(l1::SimpleSDMLayer, l2::SimpleSDMLayer)

Applies max (from Base) to every pair of cells from two SimpleSDMLayers and returns the result as a new SimpleSDMResponse layer. Note that max is only applied to the pairs without a nothing element, and returns nothing for the pairs with one. This function has been automatically generated.

source
Base.minFunction
Base.min(l1::SimpleSDMLayer, l2::SimpleSDMLayer)

Applies min (from Base) to every pair of cells from two SimpleSDMLayers and returns the result as a new SimpleSDMResponse layer. Note that min is only applied to the pairs without a nothing element, and returns nothing for the pairs with one. This function has been automatically generated.

source
Base.:+Function
Base.+(l1::SimpleSDMLayer, l2::SimpleSDMLayer)

Applies + (from Base) to every pair of cells from two SimpleSDMLayers and returns the result as a new SimpleSDMResponse layer. Note that + is only applied to the pairs without a nothing element, and returns nothing for the pairs with one. This function has been automatically generated.

source
Base.:-Function
Base.-(l1::SimpleSDMLayer, l2::SimpleSDMLayer)

Applies - (from Base) to every pair of cells from two SimpleSDMLayers and returns the result as a new SimpleSDMResponse layer. Note that - is only applied to the pairs without a nothing element, and returns nothing for the pairs with one. This function has been automatically generated.

source
Base.:*Function
Base.*(l1::SimpleSDMLayer, l2::SimpleSDMLayer)

Applies * (from Base) to every pair of cells from two SimpleSDMLayers and returns the result as a new SimpleSDMResponse layer. Note that * is only applied to the pairs without a nothing element, and returns nothing for the pairs with one. This function has been automatically generated.

source
Base.:/Function
Base./(l1::SimpleSDMLayer, l2::SimpleSDMLayer)

Applies / (from Base) to every pair of cells from two SimpleSDMLayers and returns the result as a new SimpleSDMResponse layer. Note that / is only applied to the pairs without a nothing element, and returns nothing for the pairs with one. This function has been automatically generated.

source
Base.:==Function
==(layer1::SimpleSDMLayer, layer2::SimpleSDMLayer)

Tests whether two SimpleSDMLayer elements are equal. The layers are equal if all their fields (grid, left, right, bottom, top) are equal, as verified with == (e.g., layer1.grid == layer2.grid).

source
Base.isequalFunction
isequal(layer1::SimpleSDMLayer, layer2::SimpleSDMLayer)

Tests whether two SimpleSDMLayer elements are equal. The layers are equal if all their fields (grid, left, right, bottom, top) are equal, as verified with isequal (e.g., isequal(layer1.grid, layer2.grid)).

source

## From Statistics

Statistics.meanFunction
Statistics.mean(l::SimpleSDMResponse{T}) where {T <: Number}

Applies mean (from Statistics) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Statistics.mean(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies mean (from Statistics) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Statistics.mean(layers::Array{T}) where {T <: SimpleSDMLayer}

Applies mean (from Statistics) to the elements in corresponding positions from the different layers (similar to mean(a::Array{Matrix})) and returns the result as a new SimpleSDMResponse layer. Note that mean is only applied to the positions without a nothing element and returns nothing for the pairs with one. This function has been automatically generated.

source
Statistics.medianFunction
Statistics.median(l::SimpleSDMResponse{T}) where {T <: Number}

Applies median (from Statistics) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Statistics.median(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies median (from Statistics) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Statistics.stdFunction
Statistics.std(l::SimpleSDMResponse{T}) where {T <: Number}

Applies std (from Statistics) to an object of type SimpleSDMResponse. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Statistics.std(l::SimpleSDMPredictor{T}) where {T <: Number}

Applies std (from Statistics) to an object of type SimpleSDMPredictor. This function has been automatically generated. Note that this function is only applied to the non-nothing elements of the layer, and has no method to work on the dims keyword; the grid itself can be extracted with convert(Matrix, l).

source
Statistics.std(layers::Array{T}) where {T <: SimpleSDMLayer}

Applies std (from Statistics) to the elements in corresponding positions from the different layers (similar to mean(a::Array{Matrix})) and returns the result as a new SimpleSDMResponse layer. Note that std is only applied to the positions without a nothing element and returns nothing for the pairs with one. This function has been automatically generated.

source
Statistics.quantileFunction
quantile(layer::T, p) where {T <: SimpleSDMLayer}

Returns the quantiles of layer at p, using Statistics.quantile.

source