0.0.67
The load function takes a url to a geotiff or geotiff file as an input and returns a promise. The promise resolves as a georaster, which can be used as input in other geoblaze methods, such as identify, sum, or histogram.
const sums = geoblaze.load(urlOrFile).then(georaster => sum(georaster, geometry));
The get function takes a raster and a bounding box as input. It returns the subset of pixels in the raster found within the bounding box. It also takes an optional parameter "flat" which will flatten the returning pixel matrix across bands instead of retaining a nested array structure.
(Object)
a raster from the georaster library
(Object)
can be an
[
xmin, ymin, xmax, ymax
]
array, a [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
(Boolean)
whether or not the resulting output should be flattened into a single array
Object
:
array of pixel values
const pixels = geoblaze.get(georaster, geometry);
Given a raster and a point geometry, the identify function returns the pixel value of the raster at the given point.
The mean function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the mean of all the pixels in that area. If no geometry is included, the function returns the mean of all the pixels for each band in the raster.
(Object)
a raster from the georaster library
(Object)
geometry can be an
[
xmin, ymin, xmax, ymax
]
array for a bounding box, [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] for a polygon, a GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
Object
:
array of means for each band
const means = geoblaze.mean(georaster, geometry);
The median function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the median of all the pixels in that area. If no geometry is included, the function returns the median of all the pixels for each band in the raster.
(Object)
a raster from the georaster library
(Object)
geometry can be an
[
xmin, ymin, xmax, ymax
]
array for a bounding box, [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] for a polygon, a GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
Object
:
array of medians for each band
const medians = geoblaze.median(georaster, geometry);
The mode function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the mode of all the pixels in that area. If no geometry is included, the function returns the mode of all the pixels for each band in the raster.
(Object)
a georaster from the georaster library
(Object)
geometry can be an
[
xmin, ymin, xmax, ymax
]
array for a bounding box, [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] for a polygon, a GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
Object
:
array of modes for each band
const modes = geoblaze.mode(georaster, geometry);
The min function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the min of all the pixels in that area for each band. If no geometry is included, the function returns the min of all the pixels for each band in the raster.
(Object)
a georaster from the georaster library
(Object)
geometry can be an
[
xmin, ymin, xmax, ymax
]
array for a bounding box, [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] for a polygon, a GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
Object
:
array of mins for each band
const mins = geoblaze.min(georaster, geometry);
The max function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the max of all the pixels in that area. If no geometry is included, the function returns the max of all the pixels for each band in the raster.
(Object)
a raster from the georaster library
(Object)
geometry can be an
[
xmin, ymin, xmax, ymax
]
array for a bounding box, [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] for a polygon, a GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
Object
:
array of maxs for each band
const maxs = geoblaze.max(georaster, geometry);
The sum function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the sum of all the pixels in that area. If no geometry is included, the function returns the sum of all the pixels for each band in the raster.
(Object)
a georaster from the georaster library
(Object)
geometry can be an
[
xmin, ymin, xmax, ymax
]
array for a bounding box, [[
[
x00,y00
]
,...,
[
x0n,y0n
]
,
[
x00,y00
]
]...] for a polygon, a GeoJSON polygon object, or a string representation of a GeoJSON polygon object.
Object
:
array of sums for each band
const sums = geoblaze.sum(georaster, geometry);
The histogram function takes a raster as an input and an optional geometry. If a geometry is included, the function returns the histogram of all the pixels in that area. If no geometry is included, the function returns the histogram of all the pixels for each band in the raster.
(Object)
georaster from georaster library
(Object
= undefined
)
a geometry, which we'll use for clipping result
Object
:
array of histograms for each band
var histograms = geoblaze.histogram(georaster, geometry);
The band arithmetic function takes a raster and an arithmetic operation written as a string as input. The function performs pixel-by-pixel calculation according to the arithmetic operation provided. This is only possible for a multiband raster and not for single band rasters. The output is a computed single band raster.
(Object)
a raster from the georaster library
(String)
a string representation of a arithmetic operation to perform
Object
:
raster - the computed georaster
const ndvi = geoblaze.bandArithmetic(georaster, '(c - b)/(c + b)');
The raster calculator function takes a raster and a javascript function as input. The function is performed pixel-by-pixel on each cell in the raster. The arguments to the function should reference bands in the order in the raster
(Object)
a raster from the georaster library
(String)
a string representation of a arithmetic operation to perform
Object
:
raster - the computed georaster
const filteredRaster = geoblaze.rasterCalculator(georaster, (a, b, c) => a + b === c ? 1 : 0);