geoCircle

Takes a GeoJSON Point and calculates the circle polygon given a radius in units (default units are kilometers).

Syntax

geoCircle(point, radius[, units])

Parameters

ParameterDescription
pointRequired. The center of the circle as either coordinates or a GeoJSON Point.
radiusRequired. The radius of the circle as an integer or decimal.
unitsOptional.¬†Specified as a string. Options are ‘degrees’, ‘radians’, ‘miles’, or ‘kilometers’. Default is ‘kilometers’.

Example 1

Return a GeoJSON circle with a radius of 1.5 miles from a given point., in kilometers, of a manually passed GeoJSON linestring.

SELECT geoCircle('[-104.979127,39.761563]', 1.5, 'miles')

Example 2

Generate a heatmap of interest based on points. The geo_data column stores a given point and the interest column stores an interest score, which will be used as the radius of the circle.

SELECT geoCircle(geo_data, interest, 'miles') 
FROM dev.locations