SimpleSDMLayers
SimpleSDMLayers._read_geotiff
— Methodgeotiff(file; bandnumber::Integer=1, left=nothing, right=nothing, bottom=nothing, top=nothing, driver)
The geotiff function reads a geotiff file, and returns it as a matrix of the correct type. The optional arguments left
, right
, bottom
, and left
are defining the bounding box to read from the file. This is particularly useful if you want to get a small subset from large files.
SimpleSDMLayers._write_geotiff
— Methodgeotiff(file::AbstractString, layers::Vector{SDMLayer{T}}; nodata::T=convert(T, -9999)) where {T <: Number}
Stores a series of layers
in a file
, where every layer in a band. See geotiff
for other options.
SimpleSDMLayers.interpolate
— Methodinterpolate(layer::SDMLayer, destination::SDMLayer)
Interpolates a layer target
so that it uses the same grid, crs, etc as destination
.
SimpleSDMLayers.interpolate
— Methodinterpolate(layer::SDMLayer; dest="+proj=natearth2", newsize=nothing)
Returns an interpolated version of the later under the new destination CRS (natearth2 by default), and with optionally a new size of newsize
.
SimpleSDMLayers.mask!
— Methodmask!(layer::SDMLayer, template::SDMLayer)
Updates the positions in the first layer to be those that have a value in the second layer.
SimpleSDMLayers.mask
— Methodmask(layer::SDMLayer, template::SDMLayer)
Returns a copy of the first layer masked according to the second layer. See also mask!
.
SimpleSDMLayers.mosaic
— Methodmosaic(f, stack::Vector{<:SDMLayer})
Returns a layer that is the application of f
to the values at each cell in the array of layers given as the second argument.
SimpleSDMLayers.nodata!
— Methodnodata!(layer::SDMLayer{T}, f)
Removes the data matching a function
SimpleSDMLayers.nodata!
— Methodnodata!(layer::SDMLayer{T}, nodata::T) where {T}
Changes the value of the layer representing no data. This modifies the layer passed as its first argument.
SimpleSDMLayers.nodata
— Methodnodata(layer::SDMLayer, args...)
Makes a copy and calls nodata!
on it
SimpleSDMLayers.tiles
— Functiontiles(layer::SDMLayer, size::Tuple{Int64,Int64})
SimpleSDMLayers.SDMLayer
— TypeSDMLayer{T}
Defines a layer of geospatial information.
The type has two data fields:
- grid: a
Matrix
of typeT
- indices: a
BitMatrix
to see which positions are valued
Each row in the grid
field represents a slice of the raster of equal northing, i.e. the information is laid out in the matrix as it would be represented on a map once displayed. Similarly, columns have the same easting.
The geospatial information is represented by three positional fields:
- x and y: two tuples, indicating the coordinates of the corners alongside the x and y dimensions (e.g. easting/northing) - the default values are
(-180., 180.)
and(-90., 90.)
, which represents the entire surface of the globe in WGS84 - crs: any
String
representation of the CRS which can be handled byProj.jl
- the default is"+proj=longlat +datum=WGS84 +no_defs"
, which represents a latitude/longitude coordinate system