Skip to main content
Version: 7.0.0

geoprocessing

geoprocessing is the main module used by a geoprocessing project. It includes everything needing for creating, building, testing, and deploying a geoprocessing project with the exception of UI components which are exported separately in client-ui.

Index

Classes

ClassDescription
ComplexityErrorError signifying function threw due to not being able to handle the input - e.g. size/complexity
GeoprocessingHandlerManages the task of executing a geoprocessing function within an AWS Lambda function. This includes sending estimate of completion, caching the results, and getting them back to the client. Supports 2 different execution modes for running a geoprocessing function - sync and async These modes create 3 different request scenarios. A lambda is created for each scenario, and they all run this one handler. 1 - sync executionMode - immediately run gp function and return result in resolved promise to client 2 - async executionMode, ASYNC_REQUEST_TYPE=start - invoke a second lambda to run gp function and return incomplete task to client with socket for notification of result 3 - async executionMode, ASYNC_REQUEST_TYPE=run - run gp function started by scenario 2 and send completed task info on socket for client to pick up result
PreprocessingHandlerLambda handler for a preprocessing function
ProjectClientBaseClient for reading project configuration/metadata.
ValidationErrorError signifying input is not valid
VectorDataSource-

Interfaces

InterfaceDescription
BaseImportDatasourceConfig-
CalcStatsOptionsoptions accepted by geoblaze.stats() to calc-stats library See https://github.com/DanielJDufour/calc-stats/tree/main?tab=readme-ov-file#advanced-usage
ClipOptionsOptional parameters for polygon clip preprocessor
DatasourceClipOperationParameters for clip operation using a datasource
DatasourceOptions-
DefaultExtraParamsCommon set of extra parameters that might be passed to a geoprocessing function Replace or extend these as needed, there is nothing special about the param names other than to be descriptive of what they represent.
FeatureA feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2
FeatureClipOperationParameters for clip operation using polygon features
FeatureCollectionA collection of feature objects. https://tools.ietf.org/html/rfc7946#section-3.3
FeatureMapA simple map of features keyed by their name
FeatureTree-
FgBoundingBox-
GeogProp-
GeometryCollectionGeometry Collection https://tools.ietf.org/html/rfc7946#section-3.1.8
GeoprocessingHandlerOptions-
GeoprocessingProject-
GeoprocessingRequestModelGeoprocessing request internal data model, with full objects, no JSON strings
GeoprocessingServiceMetadataExpected public service metadata for each function
GeoprocessingTask-
Georaster-
GetDatasourceFeaturesOptions-
Histogram-
HistogramOptions-
IucnActivity-
IucnActivityRank-
IucnCategory-
IucnCategoryCombined-
LineStringLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.4
MetricGroupItem-
MetricPackAlternative JSON format for metrics data that is smaller in size, better suited for blob storage and network transport
MultiLineStringMultiLineString geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.5
MultiPolygonMultiPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.7
Node-
NullSketch-
NullSketchCollection-
OverlapRasterOptionsoptions accepted by rasterStats
PercentEdgeOptions-
PointPoint geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2
PolygonPolygon geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.6
PreprocessingHandlerOptions-
PreprocessingRequest-
PreprocessingResponse-
PreprocessingService-
PreprocessingServiceMetadata-
ProjectClientConfig-
ProjectClientInterface-
RasterStatsOptionsoptions accepted by rasterStats
RbcsObjective-
RegBasedClassificationMetricExtended metric for mpa-reg-based-classification results, either zone or mpa classification
ReportRepresents a single report, with one or more metrics
ReportContextValueProvides necessary context to ReportClient components, particularly for use by useFunction() and useSketchProperties() hooks
ReportResultReport results consist of collections of metrics for sketches
ReportResultBaseMetrics for reports not associated with sketches. Used for precalculation
RootTaskItem-
SeaSketchReportingMessageEvent-
SeaSketchReportingToggleLanguageEvent-
SeaSketchReportingToggleLayerVisibilityEvent-
SeaSketchReportingVisibleLayersChangeEvent-
Sketch-
SketchCollection-
SketchMapA simple map of sketches and/or sketch collections keyed by their name
StatsObject-
TestExampleOutput-
VectorDataSourceDetails-
VectorDataSourceOptions-
VectorFeatureA feature object which contains a geometry and associated properties. https://tools.ietf.org/html/rfc7946#section-3.2
VectorPropertyFilterSpecify one or more literal values for one or more vector Feature properties
WindowOptionsdefines the new raster image to generate as a window in the source raster image. Resolution (cell size) is determined from this

Enumerations

EnumerationDescription
GeoprocessingTaskStatus-

Functions

FunctionDescription
anchorScore-
aquacultureScore-
areaCalculates the area of each sketch and collection.
batchDelete-
batchDeleteTasksBatch delete array of tasks
bboxOverlapReturns whether bounding box A overlaps with or touches bounding box B
biggestPolygonIf feature is a MultiPolygon, scans and returns the polygon with the largest area.
booleanOverlapReturns all B items that overlap with a A items Not all Feature types are supported, see typedoc A and B must have the same geometry dimension (single or multi). Builds on @turf/boolean-overlap.
byteSizeGet length of string in bytes
callWithRetryCalls given function and if error thrown, it recursively retries function up to maxTry times, then just rethrows the error
capitalizeCapitalizes the first letter of string
chunkSplits an array into chunks of size
classIdMappingReturns mapping of class ID to class DataClass objects
classifyMPAGiven zone scores, returns object containing final scores, and mpa classification
classifyZoneGiven activity scores, returns zone number
cleanBBoxNormalizes bounding box longitude values to the [-180, 180] range if they cross the antimeridian
cleanCoordsCleans geojson coordinates to be within the bounds of the world [-90, -180, 90, 180], so that they don't wrap off the end, and can be split
clipPerforms one of 4 different clip operations on features
clipMultiMergePerforms clip after first merging features2 coords into a single multipolygon. Avoids errors in underlying clipping library when too many features in features2
clipToPolygonDatasourcesTakes a Polygon feature and returns the portion remaining after performing clipOperations against one or more datasources
clipToPolygonFeaturesTakes a Polygon feature and returns the portion remaining after performing clipOperations against one or more Polygon features
collectionHasGeometry-
createMetricCreates a new metric. Defaults to ID values of null and then copies in passed metric properties
createMetricsCreates fully defined metrics from partial. Metric values not provided are initialized to null
ensureValidPolygonReturns true if feature is valid and meets requirements set by options.
featureToSketchConverts Feature to Sketch with reasonable defaults given for sketch properties if not provided
featureToSketchCollectionConverts FeatureCollection to SketchCollection with reasonable defaults given for sketch properties if not provided
fetchGeoJSONGiven geoprocessing function request, fetches the GeoJSON, which can also be sketch JSON
fgbFetchAllFetch features from flatgeobuf at url that intersect with bounding box Retries up to 3 times if fetch fails in error
fgBoundingBox-
findAndUpdateMetricValueReturns new sketchMetrics array with first sketchMetric matched set with new value. If no match, returns copy of sketchMetrics. Does not mutate array in place.
firstMatchingReturns the first item that returns true for filter
firstMatchingMetricReturns the first metric that returns true for metricFilter
flattenByGroupAllClassAggregates metrics by group
flattenByGroupSketchAllClassFlattens group class metrics, one for each group and sketch. Each object includes the percValue for each class, and the total percValue with classes combined groupId, sketchId, class1, class2, ..., total
flattenBySketchAllClassFlattens class sketch metrics into array of objects, one for each sketch, where each object contains sketch id, sketch name, and all metric values for each class
flattenSketchAllIdReturns one aggregate object for every sketch ID present in metrics, with additional property for each unique value for idProperty present for sketch. Example - idProperty of 'classId', and two classes are present in metrics of 'classA', and 'classB' then each flattened object will have two extra properties per sketch, .classA and .classB, each with the first metric value for that sketch/idProperty found
gearTypeScore-
genClipToPolygonDatasourcesReturns a function that Takes a Polygon feature and returns the portion remaining after performing clipOperations against one or more datasources
genClipToPolygonFeaturesReturns a function that applies clip operations to a feature using other polygon features.
genFeatureReturns a Feature with given features geometry and properties. Reasonable defaults are given for properties not provided Default geometry is a square from 0,0 to 1,1
genFeatureCollectionGiven array of features, return a feature collection with given properties. Generates reasonable default values for any properties not passed in The geometry type of the returned collection will match the one passed in Properties of features are retained
genRandomPolygonsGenerates random polygons within provided bounds. numPolygons defaults to 300, max_radial_length to 0.5 Wrapper around @turf/random - https://turfjs.org/docs/#randomPolygon
genSampleNullSketchReturns a Sketch with given geometry and Geometry type, Properties are reasonable random
genSampleNullSketchCollectionGiven feature collection, return a sketch collection with reasonable random props. The geometry type of the returned collection will match the one passed in
genSampleSketchReturns a Sketch with given geometry and Geometry type, Properties are reasonable random
genSampleSketchCollectionGiven feature collection, return a sketch collection with reasonable random props. The geometry type of the returned collection will match the one passed in
genSampleSketchCollectionFromSketchesGiven feature collection, return a sketch collection with reasonable random props. The geometry type of the returned collection will match the one passed in
genSampleSketchContext-
genSampleUserAttributes-
genSketchReturns a Sketch with given features geometry and properties. Reasonable defaults are given for properties not provided Default geometry is a square from 0,0 to 1,1
genSketchCollectionGiven array of sketches, return a sketch collection with given properties. Generates reasonable default values for any properties not passed in The geometry type of the returned collection will match the one passed in Properties of sketches are retained
genTaskCacheKeyGenerates a cache key for a geoprocessing request, given sketch properties and optional extra parameters (must be JSON compatible object) Extra parameters are canonicalized and hashed using md5 to ensure cache key is consistent. Canonicalization ensures object keys are consistent but not arrays. If you use arrays as extraParam values, make sure the order stays the same and sort first if needed to generate a consistent cache key.
genZodErrorMessage-
getAreaReturns area of valid raster cells (not nodata) overlapping with feature. If no valid cells found, returns 0.
getClassificationLabel-
getCogFilename-
getDatasetBucketName-
getDatasourceByIdfind and return datasource from passed datasources
getDatasourceFeaturesFetches and returns features for a given datasource supporting a variety of formats/clients
getExternalRasterDatasourceByIdfind and return external raster datasource from passed datasources
getExternalVectorDatasourceByIdfind and return external vector datasource from passed datasources
getFeaturesFetches and returns features for a given datasource supporting a variety of formats/clients
getFeaturesForBBoxesLoads features from a FlatGeobuf referenced by URL, which intersect the bounding boxes. Deduplicates features given uniqueIdProperty (faster) or using md5 hash of feature coordinates (slower).
getFeaturesForSketchBBoxesLoads features from a FlatGeobuf referenced by URL, which intersect the bounding boxes of each individual sketch in a SketchCollection, or a single Sketch.
getFirstFromParamReturns first element from param object at paramName key. Parameter can be string or array of strings
getFlatGeobufFilenameReturns datasource filename in flatgeobuf format
getFlatGeobufPath-
getGeopackagePath-
getHistogramReturns histogram of value overlap with geometry. If no cells with a value are found within the geometry overlap, returns 0.
getIndexIconPercReturns percent protection given index value, percent is proportion (percent) of bottom color to top color to use for icon given index value (as shown in paper) e.g. index = 5.4 means bottom icon color should take 25% of icon and top color 75%
getInternalRasterDatasourceByIdfind and return internal datasource from passed datasources
getInternalVectorDatasourceByIdfind and return internal vector datasource from passed datasources
getIucnCategoryForActivitiesGiven list of allowed activities in the sketch, returns the highest category allowable The lack of an activity assumes it is not allowed
getIucnCategoryForSketchesReturn Category for each sketch keyed by sketchId
getIucnCategoryNameForSketchesReturn Category name for each sketch keyed by sketchId
getIucnLevelNameForSketchesReturn level name for each sketch keyed by sketchId
getJsonFilenameReturns datasource filename in geojson format
getJsonPath-
getJsonUserAttribute-
getKeysObject.keys helper that returns strongly typed key values. Uses assertion so make sure your type covers all the keys!
getMetricGroupObjectiveIdReturns the objectiveId assigned to the given MetricGroup. If classId provided, returns the objective ID assigned to data class with that classId, else fallback to metricGroup objectiveId.
getMetricGroupObjectiveIdsReturns array of objective IDs for the given MetricGroup. If at least one class has an objectiveId assigned, then it returns those, missing classes with no objectiveId get the top-level objectiveId If no class-level objectives are found, then it returns the top-level objectiveId If no objectives are found, returns an empty array
getMinYesCountMapReturns an object mapping objective ID to ID of first classification that counts toward objective
getMpaClassificationNameReturns protection level given MPA classification index value
getObjectiveByIdfind and return objectives from passed objectives
getParamStringArrayValidates and returns string[] parameter from extraParams. If param missing it returns an empty array
getRasterBoxSpherical-
getRasterDatasourceByIdfind and return raster datasource (internal or external) from passed datasources
getSketchCollectionChildIdsGiven sketch collection, returns IDs of sketches in the collection
getSketchFeaturesGiven sketch or sketch collection, returns just the individual sketch features inside.
getSketchToMpaProtectionLevelReturns object mapping sketch id to MPA classification given sketch for rbcsMpa or collection of sketches for rbcsMpas with rbcs activity userAttributes, and area metrics for each sketch, assumes each mpa is a single zone mpa
getSumReturns sum of raster value overlap with geometry. If no cells with a value are found within the geometry overlap, returns 0.
getUserAttributeUserAttributes are those filled in via the attributes form specified as part of a SketchClass. This getter function is easier to use than searching the Sketch.properties.userAttributes array, supports default values, and is easier to use with typescript.
getVectorDatasourceByIdfind and return vector datasource (internal or external) from passed datasources
getZoneClassificationName-
groupBySimilar to lodash groupBy
hasOwnPropertyType narrowing to allow property checking when object can be multiple types https://fettblog.eu/typescript-hasownproperty/ Any code inside a block guarded by a conditional call to this function will have type narrowed to X
includeVirtualSketchIf sketch collection passes sketchTest, then returns new collection with mergeSketchColl sketches appended and updated bbox
intersectInChunksCalculates area overlap between a feature A and a feature array B. Intersection is done in chunks on featuresB to avoid errors due to too many features
intersectSumReturns an object containing the sum value of features in B that intersect with featureA, and the indices of the features in B that intersect with featureA No support for partial overlap, counts the whole feature if it intersects.
isExternalDatasource-
isExternalRasterDatasource-
isExternalVectorDatasource-
isFeatureCheck if object is a Feature. Any code inside a block guarded by a conditional call to this function will have type narrowed
isFeatureCollectionCheck if object is a Feature Collection. Any code inside a block guarded by a conditional call to this function will have type narrowed
isGeometryCheck if object is a Feature. Any code inside a block guarded by a conditional call to this function will have type narrowed to Feature
isImportRasterDatasourceConfig-
isImportVectorDatasourceConfig-
isinternalDatasource-
isInternalRasterDatasource-
isInternalVectorDatasource-
isLineStringFeatureCheck if object is a Linestring. Any code inside a block guarded by a conditional call to this function will have type narrowed
isLineStringSketchCollection-
isMetricChecks if object is a Metric and returns narrowed type
isMetricArrayChecks if object is a Metric array and returns narrowed type
isMetricPackChecks if object is a MetricPack. Any code inside a block guarded by a conditional call to this function will have type narrowed to MetricPack
isMultiPolygonFeatureCheck if object is a MultiPolygon. Any code inside a block guarded by a conditional call to this function will have type narrowed
isMultiPolygonSketchChecks if sketch is a MultiPolygon. Any code inside a block guarded by a conditional call to this function will have type narrowed to Sketch
isMultiPolygonSketchCollection-
isNullSketchChecks if object is a NullSketch. Any code inside a block guarded by a conditional call to this function will have type narrowed to NullSketch
isNullSketchCollectionCheck if object is a NullSketchCollection. Any code inside a block guarded by a conditional call to this function will have type narrowed to NullSketchCollection
isObject-
isPointFeatureCheck if object is a Point. Any code inside a block guarded by a conditional call to this function will have type narrowed
isPointSketchCollection-
isPolygonAllSketchCollection-
isPolygonAnyFeatureCheck if object is a Polygon or MultiPolygon. Any code inside a block guarded by a conditional call to this function will have type narrowed
isPolygonFeatureCheck if object is a Polygon feature. Any code inside a block guarded by a conditional call to this function will have type narrowed
isPolygonFeatureArrayCheck if object is an array of Polygon features. Any code inside a block guarded by a conditional call to this function will have type narrowed
isPolygonSketchChecks if sketch is a Polygon
isPolygonSketchCollection-
isRasterDatasource-
isRbcsProtectionLevelType guard for checking string is one of supported objective IDs Use in conditional block logic to coerce to type RbcsObjectiveKey within the block
isSketchChecks if object is a Sketch. Any code inside a block guarded by a conditional call to this function will have type narrowed to Sketch
isSketchCollectionCheck if object is a SketchCollection. Any code inside a block guarded by a conditional call to this function will have type narrowed to SketchCollection
isTruthyAttributeValue-
isVectorDatasource-
keyBySimilar to lodash keyBy
loadCogReturns cog-aware georaster at given url. If fetch fails, will retry up to 3 times Will not fetch raster values until subsequent geoblaze calls are made with a geometry and it will calculate the window to load based on the geometry. The subsequent geoblaze calls (e.g. sum) must be called async to allow the raster to load.
loadFgbFetch features from flatgeobuf at url that intersect with bounding box Retries up to 3 times if fetch fails in error
loadFgbFromDiskSynchronously load a flatgeobuf file from disk. Assumed to be in WGS84 EPSG:4326 projection
maxWidthReturns the maximum width of the geojson or bbox
metricsForSketchReturns metrics for given sketch (can be an array of sketches)
metricsSketchIdsReturns metrics with matching sketchId (can be an array of sketchids)
metricsWithClassIdReturns metrics with matching sketchId (can be an array of sketchids)
metricsWithSketchIdReturns metrics with matching sketchId (can be an array of sketchids)
minWidthReturns the minimum width of the bounding box of given feature
mpaClassMetricGiven sketch for rbcsMpa with rbcs activity userAttributes, assumes mpa is a single zone mpa and returns metrics with mpa classification score
mpaClassMetricsGiven sketch for rbcsMpa or collection of sketches for rbcsMpas with rbcs activity userAttributes, assumes each mpa is a single zone mpa and returns metrics with mpa classification score Collection metric will have mpa classification score index as value
nestMetricsRecursively groups metrics by ID in order of ids specified to create arbitrary nested hierarchy for fast lookup. Caller responsible for all metrics having the ID properties defined If an id property is not defined on a metric, then 'undefined' will be used for the key
numberFormatFormats number to string, if less than zero will leave as-is, otherwise will format as large number
overlapAreaAssuming sketches are within some outer boundary with size outerArea, calculates metric for both the area of each sketch and the percentage of outerArea they take up. If sketch is a collection, will return metrics for each child sketch as well as the collection collection level metric will calculated by unioning child sketches to remove overlap. If collection level calculation produces an "Unable to complete output ring" error, it will fallback to simplify the sketch with simplifyTolerance (default to .0000001 if not passed) and try again.
overlapAreaGroupMetricsGenerate overlap group metrics using overlapArea operation
overlapFeaturesCalculates overlap between sketch(es) and an array of polygon features. Supports area or sum operation (given sumProperty), defaults to area If sketch collection includes overall and per sketch
overlapFeaturesGroupMetricsGenerate overlap group metrics using overlapFeatures operation
overlapGroupMetricsGiven overlap metrics stratified by class and sketch, returns new metrics also stratified by group Assumes a sketch is member of only one group, determined by caller-provided metricToGroup For each group+class, calculates area of overlap between sketches in group and featuresByClass (with overlap between group sketches removed first) Types of metrics returned: sketch metrics: copy of caller-provided sketch metrics with addition of group ID overall metric for each group+class: takes sketches in group, subtracts overlap between them and overlap with higher group sketches, and runs operation If a group has no sketches in it, then no group metrics will be included for that group, and group+class metric will be 0
overlapPolygonAreaCalculates area of overlap between sketch(es) and an array of polygon features. Truncates input geometry coordinates down to 6 decimal places (~1m accuracy) before intersection to avoid floating point precision issues. If sketch collection, then calculates area for each child sketch and the whole collection, without overcounting sketch overlap
overlapPolygonSumCalculates area overlap between sketch(es) and an array of polygon features. Truncates input geometry coordinates down to 6 decimal places (~1m accuracy) before intersection to avoid floating point precision issues. If sketch collection, then calculates area per sketch and for sketch collection
overlapRasterClassCalculates sum of overlap between sketches and a categorical raster with numeric values representing feature classes If sketch collection, then calculate overlap for all child sketches also
overlapRasterGroupMetricsGenerate overlap group metrics using rasterMetrics operation
overlapSubareaReturns area stats for sketch input after performing overlay operation against a subarea feature. Includes both area overlap and percent area overlap metrics, because calculating percent later would be too complicated For sketch collections, dissolve is used when calculating total sketch area to prevent double counting
packMetricsConverts Metric array to a new MetricPack. Assumes metric dimensions are consistent for each element in the array, and null values are used
parseGeoraster-
parseLambdaResponseParses result from worker lambda
percentGoalWithEdgeSpecial percent formatter designed to produce readable percent values for display given an upper percent goal All parameters are expected to be decimal percent values e.g. .001 = 1/10th of a percent.
percentWithEdgeSpecial percent formatter designed to produce readable percent values for display with special handling of numbers within some edge range of user-defined lower or upper bounds. Defaults to handle only lower edge with lowerBound = 0 and lower = .001. All bound values are expected to be in decimal percent. So 1/10th of a percent is .001
randomFloat-
randomInt-
rasterMetricsCalculates summary metrics (stats/area) on given raster, optionally intersecting raster with provided feature (zonal statistics). If feature is a collection, then calculate metrics for each individual feature as well as the collection as a whole. This can be disabled with includeChildMetrics: false. Defaults to assuming a continuous raster but also supports categorical option
rasterStatsCalculates over 10 different raster statistics, optionally constrains to raster cells overlapping with feature (zonal statistics). Defaults to calculating only sum stat If no raster cells with value found, returns 0 or null value for each stat as appropriate.
rasterStatsToMetricsConverts an array of geoblaze raster StatsObject to an array of Metrics
rbcsMpaToMetric-
rbcsZoneToMetricTransforms an rbcs zone object to a metric
rekeyMetricsReorders metrics (by mutation) to a consistent key order for readability
rekeyObjectReorders object, mutating in place, in the order provided
removeOverlapRemoves overlap between polygons and returns result as a single polygon or multipolygon The result has no connection to the original features and their properties in this process
removeSketchCollPolygonHoles-
removeSketchPolygonHoles-
roundDecimalRounds number to a fixed number of decimals
roundDecimalFormatRounds number to a fixed number of decimals, then formats as a human readable string
roundLowerFormats number to string, rounding decimal to number of digits, if value is less than lower will clamp to lower value
runLambdaWorkerRuns a function on a specified lambda worker
sampleSketchReportContextValueCreates a ReportContextValue object for a Sketch with sample values. overrides will be merged in, replacing default values
scanTasks-
sketchToIdGiven sketch(es), returns ID(s)
sketchToZone-
sortMetricsSorts metrics to a consistent order for readability Defaults to [metricId, classId, sketchId]
sortMetricsDisplayOrderSorts metrics by ID given a user-defined metric dimension (sortId) and array of ID values in the order they should be sorted Useful for applying a "display order" to metrics Example - sortId = classId, displayOrder = ['sand','gravel','coral']
splitBBoxAntimeridianIf bounding box crosses antimeridian (and extends outside the range of -180 to 180), split it into two bounding boxes at the antimeridian.
splitFeatureAntimeridianSplits a Feature or FeatureCollection on the 180 degree antimeridian. The bbox property of the result will have longitude coordinates that are shifted/normalized to be within the range of -180 to 180.
splitSketchAntimeridianSplits a Sketch or SketchCollection on the 180 degree antimeridian The bbox property of the result will have longitude coordinates that are shifted/normalized to be within the range of -180 to 180.
squareMeterToKilometerConverts value from square meters to square kilometers
squareMeterToMileConverts value from square meters to square miles
testWithinPercExpects that testValue is equal to expectedValue or optionally within percentage (defaults to .01 or 1%)
toChildPropertiesReturns SketchProperties for each child sketch in a SketchCollection
toFeatureArrayHelper to convert a Feature or a FeatureCollection to a Feature array
toFeaturePolygonArray-
toJsonFile-
toMultiPolygonConverts collection of polygons or multipolygons to a single multipolygon
toNullSketchReturns sketch or sketch collection with null geometry
toNullSketchArrayHelper to convert a NullSketch or NullSketchCollection to a NullSketch array
toPercentMetricMatches numerator metrics with denominator metrics and divides their value, returning a new array of percent metrics. Matches on the optional idProperty given, otherwise defaulting to classId Deep copies and maintains all other properties from the numerator metric If denominator metric has value of 0, returns NaN NaN allows downstream consumers to understand this isn't just any 0. It's an opportunity to tell the user that no matter where they put their sketch, there is no way for the value to be more than zero. For example, the ClassTable component looks for NaN metric values and will automatically display 0%, along with an informative popover explaining that no data class features are within the current geography.
toRasterProjectionReprojects a feature to the same projection as the raster.
toShortSketchesReturns an array of shorthand sketches (id + name) given a Sketch or SketchCollection. Includes a shorthand of parent collection also
toSketchArrayConverts a Sketch or SketchCollection to a Sketch array, maintaining geometry type Useful for putting in a consistent form that can be iterated over
toSketchPropertiesArrayConverts array of sketches to an array of their SketchProperties
unpackMetricsConverts MetricPack to a new Metric array.
updateCommandsSyncRun dynamodb update commands synchronously to avoid throttling, retrying on ThroughputError
valueFormatterGiven a number or string value and the name of a formatter function, returns a formatted value
zeroPolygonReturns a zero polygon geometry (three [0,0] coordinates)
zeroSketchGiven sketch, returns the mutated sketch with a zero polygon geometry (three [0,0] coordinates)
zeroSketchArrayGiven sketch array, returns the mutated sketches with a zero polygon geometry (three [0,0] coordinates)
zeroSketchCollectionGiven sketch collection, returns the mutated collection with all child sketches switched to have zero polygon geometry (three [0,0] coordinates)
zoneClassMetricsGiven sketch for rbcsZone or collection of zone sketches with userAttributes for rcbs activities, returns metrics with zone classification score as value. If sketch collection, collection metric will have mpa classification score index as value

Type Aliases

Type aliasDescription
bandArithmetic-
BaseDatasource-
BBoxBounding box https://tools.ietf.org/html/rfc7946#section-5
ClassificationIdUnique string ID for classification given to sketches (e.g. zone classification, protection level)
ClassStats-
ClientJsonConfigRepresents a geoprocessing client object
ClipOperationsSupported clip operations
DataClassRepresents a group of data classes. Used to access the data, and calcualte metrics based on them. This interface is murky but it supports a variety of scenarios: - Vector dataset with one feature class - Vector dataset with multiple feature class, each with their own file datasource, and possibly only one layerId to display them all - Vector dataset with multiple feature classes, all in one file datasource, each class with its own layerId - Raster with multiple feature classes represented by unique integer values that map to class names
Datasource-
EezLandUnion-
ExecutionMode-
ExternalRasterDatasource-
ExternalVectorDatasource-
EXTRA_RASTER_STAT-
FunctionExtraParams-
GEOBLAZE_RASTER_STAT-
Geographies-
Geography-
GeoJsonProperties-
GeometryGeometry object. https://tools.ietf.org/html/rfc7946#section-3
GeoprocessingJsonConfigRepresents a single JS package
GeoprocessingRequestGeoprocessing request sent via HTTP GET, with extraParams as url-encoded JSON string
GeoprocessingRequestParams-
GeorasterMetadata-
GeoTypes-
get-
GroupMetricAggSingle flattened metric with class values keyed by class name Useful for rendering table rows with the values of multiple classes for a group
GroupMetricSketchAgg-
histogram-
identify-
ImportRasterDatasourceConfig-
ImportRasterDatasourceOptions-
ImportVectorDatasourceConfigFull configuration needed to import a dataset
ImportVectorDatasourceOptions-
InternalRasterDatasource-
InternalVectorDatasource-
ISO8601DateTime-
ISO8601Duration-
IucnActivityRankId-
JSONValue-
load-
LoadedPackage-
max-
mean-
median-
MetricSingle record of value, stratified in one or more dimensions. The name Metric is an overgeneralization, you can think of it as a MetricValue.
MetricDimension-
MetricGroupRepresents a single metric, having one DataGroup
MetricGroups-
MetricIdTypes-
MetricProperty-
Metrics-
min-
mode-
MpaClassification-
Nullable-
Objective-
ObjectiveAnswer-
ObjectiveAnswerMapGeneric type for mapping classification ID to whether it counds toward or meets an objective Specific classification systems will extend this type with short list of allowed classification IDs
ObjectiveIdUnique name of objective
Objectives-
OsmLandFeature-
PackageRepresents a single JS package
PartialReportContextValue-
PositionA Position is an array of coordinates. https://tools.ietf.org/html/rfc7946#section-3.1.1 Array should contain between two and three elements. The previous GeoJSON specification allowed more elements (e.g., which could be used to represent M values), but the current specification only allows X, Y, and (optionally) Z to be defined.
Project-
rasterCalculator-
RasterDatasource-
RbcsMpaObjectiveAnswerMapMapping of RBCS MPA Classification ID to whether it counts toward or meets an objective
RbcsMpaProtectionLevel-
SketchGeometryTypes-
SketchPropertiesProperties of a Sketch, defines known keys as well as unknown for extensiblity
stats-
Stats-
sum-
SUPPORTED_RASTER_STAT-
SupportedFormats-
TaskKey-
TypedArrayTyped array of data values, the basic building block of a geotiff
UserAttributeUser-defined attributes with values for Sketch. Defines known keys as well as unknown for extensiblity
ValueFormatterOptions for formatting a given value.
VectorDatasource-
Zone-
ZoneColor-
ZoneId-
ZoneName-

Variables

VariableDescription
activityRanks-
baseDatasourceSchema-
bboxSchema-
box2dSchema-
box3dSchema-
classStatsSchemaPre-calculated stats by key by class
clientJsonConfigSchemaRepresents a geoprocessing client object
commonHeaders-
dataClassSchemaRepresents a single class of data. Ties it to an underlying datasource, holds attributes used for displaying in user interfaces
datasourceConfig-
datasourceFormatDescriptions-
datasourceSchema-
datasourcesSchema-
defaultReportContext-
DEFAULTS-
defaultStatValues-
externalDatasourceSchemaProperties for external datasource
externalRasterDatasourceSchema-
externalVectorDatasourceSchema-
EXTRA_RASTER_STATSAdditional raster stats calculated by geoprocessing library
extraParamsSchemaDefault set of additional parameters that a geoprocessing or preprocessing function can accept Override or extend as needed with more specific types, and use .parse() function to validate your input
fcSchemaZod schema for FeatureCollection containing polygons or multipolygons
featureSchemaZod schema for Feature containing Polygon or MultiPolygon
featuresSchema-
fixtures-
fullColor-
FULLY_PROTECTED_LEVEL-
GEOBLAZE_RASTER_STATSStats supported by geoblaze.stats() function
geoblazeDefaultStatValues-
geographiesSchema-
geographySchemaA geographic area (Polygon) for planning. Typically used to represent a planning area
geoprocessingConfigSchemaRepresents a single JS package
geoTypesSchema-
globalDatasourcesDefinitive list of global datasources for geoprocessing framework @todo: fetch from global-datasources repo
globalDatasourcesById-
highColor-
HIGHLY_PROTECTED_LEVEL-
importRasterDatasourceOptionsSchema-
importVectorDatasourceOptionsSchema-
internalDatasourceSchemaTimestamp properties to ease syncing with local/published datasource files
internalImportSchemaProperties for importing an internal datasource
internalRasterDatasourceSchema-
internalVectorDatasourceSchema-
internalVectorImportSchemaProperties for import of internal vector datasources
iucnActivities-
iucnActivityCategories-
iucnCategoriesList-
iucnCategoriesMapIUCN category definitions. Note categories 2/3 and 4/6 have been merged because they have the same allowed uses
iucnCategoryNames-
iucnLevels-
jsonSchema-
loadedPackageSchemaStricter schema for npm package.json metadata, with most fields guaranteed present
lowColor-
measurementScalesSchema-
measurementTypesSchema-
MetricDimensionsDimensions used in Metric
metricGroupSchemaDefines a metric in combination with a datasource, with one or more data classes
metricGroupsSchema-
MetricPropertiesProperties used in Metric
metricSchema-
metricsSchema-
MODERATELY_PROTECTED_LEVEL-
multipolygonSchema-
OBJECTIVE_GREEN-
OBJECTIVE_MAYBE-
OBJECTIVE_NO-
OBJECTIVE_RED-
OBJECTIVE_YELLOW-
OBJECTIVE_YES-
objectiveAnswerMapSchema-
objectiveAnswerSchema-
objectiveCountsAnswersReadonly list of possible answers for whether sketch counts toward objective
objectiveCountsColorMapObject mapping answers for whether sketch counts toward objective to stop light colors - green / yellow / red
objectiveSchemaBase planning objective, extend as needed for specific classification system or ad-hoc
objectivesSchema-
packageSchemaSchema for npm package.json metadata, as found in the wild
PLANNING_AREA_TYPES-
planningAreaTypesSchema-
polygonSchema-
POORLY_PROTECTED_LEVEL-
projectSchema-
rasterDatasourceSchemaProperties for raster datasource
rbcsAnchoringActivities-
rbcsAquacultureActivities-
rbcsConstants-
rbcsGearTypes-
rbcsMpaProtectionLevels-
rbcsScores-
ReportContext-
seaSketchReportingLanguageChangeEvent-
seaSketchReportingMessageEventType-
seaSketchReportingVisibleLayersChangeEvent-
statsSchema-
SUPPORTED_RASTER_STATSCombined raster stats supported by geoprocessing library
supportedFormatsSchema-
UNPROTECTED_LEVEL-
vectorDatasourceSchemaProperties for vector datasource
version-