The mask overload for DataFrames returns an unintuitive error if the DataFrame contains observations outside the template layer's range. For example, I encountered this when trying to create a presence-absence layer for a small region, but using a DataFrame with observations across a continent.
julia> mask_layer = mask(layer, df, Bool)
ERROR: LoadError: ArgumentError: invalid index: nothing of type Nothing
I'll fix the mask implementation to allow this, but for now a workaround is to make sure to filter out the coordinates around the layer's bounding coordinates.
The
mask
overload forDataFrames
returns an unintuitive error if the DataFrame contains observations outside the template layer's range. For example, I encountered this when trying to create a presence-absence layer for a small region, but using a DataFrame with observations across a continent.I'll fix the
mask
implementation to allow this, but for now a workaround is to make sure to filter out the coordinates around the layer's bounding coordinates.