Skip to main content

Geospatial Center

Takes a GeoJSON feature and returns the absolute center point.

Here is an example of how to use it.

This is what is inside the "Get GeoJSON Feature" funciton node:

Outputs.Feature = {
type: "Feature",
geometry: {
type: "LineString",
coordinates: [
[102.0, 0.0],
[103.0, 1.0],
[104.0, 0.0],
[105.0, 1.0],
],
},
};

This is what is inside the "Extract Coordinate" function node:

const feature = Inputs.Feature;
const coordinate = feature.geometry.coordinates;
Outputs.Text = `${coordinate[0]}, ${coordinate[1]}`;

Inputs

DataDescription
CoordinatesThe GeoJSON feature.

Outputs

DataDescription
CenterA GeoJSON feature with the center position.
SignalDescription
ChangedOccurs when the Center output is updated.