Takes a GeoJSON and measures its length in the specified units (default is kilometers).
Required. GeoJSON to measure.
Optional. Specified as a string. Options are ‘degrees’, ‘radians’, ‘miles’, or ‘kilometers’. Default is ‘kilometers’.
Calculate the length, in kilometers, of a manually passed GeoJSON linestring.
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.
SELECT *, geoLength(geo_data, 'miles') as length
WHERE geoLength(geo_data, 'miles') < 5
ORDER BY length ASC