Terranode icon

Terranode

Spatial queries via the Terranode Geospatial API

Spatial Join

AI-generated

Summary

Enrich input items with polygon attributes from a selected dataset by matching each item's latitude and longitude fields against polygon boundaries via the Terranode spatial-join API.

Inputs

  • datasetId (required) — The dataset to query against; loaded via getDatasets method, hides for calculateDistance operation
  • latField (required) — Name of the input field containing latitude values; defaults to 'lat'
  • lngField (required) — Name of the input field containing longitude values; defaults to 'lng'

Output shape

Array of items; each output item JSON includes the original input data augmented with _joined (boolean), _dataset (dataset identifier from API response), and the first matched polygon's properties (matches[0].properties). If no polygon matches, properties are an empty object.

Error items include an error field when continueOnFail is enabled; otherwise the node throws.

Examples

Example 1: Batch spatial join of item set with lat/lng fields against a polygon dataset

Set datasetId to target dataset; ensure input items contain fields matching latField and lngField values.

Links

Discussion