load

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.

load
Parameters
urlOrFile ((Object | string)) a string representation of a url or a geotiff file
Example
const sums = geoblaze.load(urlOrFile).then(georaster => sum(georaster, geometry));

get

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.

get
Parameters
raster (Object) a raster from the georaster library
boundingBox (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.
flat (Boolean) whether or not the resulting output should be flattened into a single array
Returns
Object: array of pixel values
Example
const pixels = geoblaze.get(georaster, geometry);

identify

Given a raster and a point geometry, the identify function returns the pixel value of the raster at the given point.

identify
Parameters
raster (object) a raster from the georaster library
geometry ((string | object)) geometry can be an [ x,y ] array, a GeoJSON point object, or a string representation of a GeoJSON point object.

mean

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.

mean
Parameters
raster (Object) a raster from the georaster library
geometry (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.
Returns
Object: array of means for each band
Example
const means = geoblaze.mean(georaster, geometry);

median

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.

median
Parameters
raster (Object) a raster from the georaster library
geometry (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.
Returns
Object: array of medians for each band
Example
const medians = geoblaze.median(georaster, geometry);

mode

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.

mode
Parameters
georaster (Object) a georaster from the georaster library
geometry (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.
Returns
Object: array of modes for each band
Example
const modes = geoblaze.mode(georaster, geometry);

min

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.

min
Parameters
georaster (Object) a georaster from the georaster library
geometry (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.
Returns
Object: array of mins for each band
Example
const mins = geoblaze.min(georaster, geometry);

max

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.

max
Parameters
raster (Object) a raster from the georaster library
geometry (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.
Returns
Object: array of maxs for each band
Example
const maxs = geoblaze.max(georaster, geometry);

sum

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.

sum
Parameters
georaster (Object) a georaster from the georaster library
geometry (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.
Returns
Object: array of sums for each band
Example
const sums = geoblaze.sum(georaster, geometry);

histogram

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.

histogram
Parameters
a (Object) georaster from georaster library
input (Object = undefined) a geometry, which we'll use for clipping result
Returns
Object: array of histograms for each band
Example
var histograms = geoblaze.histogram(georaster, geometry);

bandArithmetic

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.

bandArithmetic
Parameters
raster (Object) a raster from the georaster library
operation (String) a string representation of a arithmetic operation to perform
Returns
Object: raster - the computed georaster
Example
const ndvi = geoblaze.bandArithmetic(georaster, '(c - b)/(c + b)');

rasterCalculator

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

rasterCalculator
Parameters
raster (Object) a raster from the georaster library
operation (String) a string representation of a arithmetic operation to perform
Returns
Object: raster - the computed georaster
Example
const filteredRaster = geoblaze.rasterCalculator(georaster, (a, b, c) => a + b === c ? 1 : 0);