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
url_or_file ((Object | string)) a string representation of a url or a geotiff file
Example
const sums = geoblaze.load(url_or_file).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
bounding_box (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);

Basic Zonal Statistics

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 pixels 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);

identify

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

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

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 pixels 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);

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 pixels 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);

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 pixels 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);

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 pixels 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 pixels 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);

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 pixels 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);