transformations
This module contains functions that compute geometric constructions, or alter geometry size or shape.
ST_CENTERMEAN
ST_CENTERMEAN(geom)Description
Takes a Feature or FeatureCollection and returns the mean center (average of its vertices).
geom:GEOMETRYfor which to compute the mean center.
Return type
GEOMETRY
Example
SELECT carto.ST_CENTERMEAN(ST_GEOMFROMTEXT('POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))'));
-- POINT (25 27.5)ST_CENTERMEDIAN
ST_CENTERMEDIAN(geom)Description
Takes a FeatureCollection of points and computes the median center. The median center is understood as the point that requires the least total travel from all other points.
geog:GEOMETRYfor which to compute the center.
Return type
GEOMETRY
Example
ST_CENTEROFMASS
Description
Takes any Feature or a FeatureCollection and returns its center of mass. It is equivalent to ST_CENTROID.
geom:GEOMETRYfor which to compute the center of mass.
Return type
GEOMETRY
Example
ST_CENTROID
Description
Takes any Feature or a FeatureCollection as input and returns its centroid. It is equivalent to ST_CENTEROFMASS.
geom:GEOMETRYfor which to compute the centroid.
Return type
GEOMETRY
Example
ST_DESTINATION
Description
Takes a Point and calculates the location of a destination point given a distance in degrees, radians, miles, or kilometers; and a bearing in degrees. This uses the Haversine formula to account for global curvature.
geom:GEOMETRYstarting point.distance:FLOAT8distance from the origin point in the units specified.bearing:FLOAT8ranging from -180 to 180 (e.g. 0 is North, 90 is East, 180 is South, -90 is West).units(optional):VARCHAR(15)units of length. The supported options are:miles,kilometers,degreesorradians. IfNULLthe default valuekilometersis used.
Return type
GEOMETRY
Examples
ST_GREATCIRCLE
Description
Calculates a great circle route as a LineString.
start_point:GEOMETRYsource point feature.end_point:GEOMETRYdestination point feature.n_points(optional):INTnumber of points. Defaults to100.
Return type
GEOMETRY
Examples
Last updated
Was this helpful?
