geoLength
Takes a GeoJSON and measures its length in the specified units (default is kilometers).
Syntax
geoLength(geoJSON[, units])
Parameters
Parameter | Description |
---|---|
geoJSON | Required. GeoJSON to measure. |
units | Optional. Specified as a string. Options are ‘degrees’, ‘radians’, ‘miles’, or ‘kilometers’. Default is ‘kilometers’. |
Example 1
Calculate the length, in kilometers, of a manually passed GeoJSON linestring.
Example 2
Find all data plus the calculated length in miles of the GeoJSON, restrict the response to only lengths less than 5 miles, and return the data in order of lengths smallest to largest.
Last updated