constructors
This module contains functions that create new geographies from coordinates or already existing geographies.
ST_BEZIERSPLINE
ST_BEZIERSPLINE(linestring [, resolution] [, sharpness])Description
Takes a line and returns a curved version of it by applying a Bezier spline algorithm. Note that the resulting geography will be a LineString with additional points inserted.
geog:GEOMETRYinput LineString.resolution(optional):INTtotal time in milliseconds assigned to the line. Tthe default value is10000. Internal curve vertices are generated in 10 ms increments, so the maximum number of resulting points will beresolution/10(close points may be merged resulting in less points). A higher number will increase the accuracy of the result but will increase the computation time and number of points.sharpness(optional):FLOAT8a measure of how curvy the path should be between splines. If not specified, the default value of0.85will be used.
Return type
VARCHAR(MAX)
Examples
SELECT carto.ST_BEZIERSPLINE(
ST_GEOMFROMTEXT(
'LINESTRING (-76.091308 18.427501,-76.695556 18.729501,-76.552734 19.40443,-74.61914 19.134789,-73.652343 20.07657,-73.157958 20.210656)'
)
);
-- {"type": "LineString", "coordinates": [[-76.091308, 18.427501], [-76.09134585033101, 18.427508082543092], ...ST_MAKEELLIPSE
Description
Takes a Point as input and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
center:GEOMETRYcenter point.xSemiAxis:FLOAT8semi (major) axis of the ellipse along the x-axis.ySemiAxis:FLOAT8semi (minor) axis of the ellipse along the y-axis.angle(optional):FLOAT8angle of rotation (along the horizontal axis), from East in decimal degrees, positive clockwise. If not specified, the default value of0will be used.units(optional):VARCHAR(10)units of length. The supported options are: miles, kilometers, meters, and degrees. If not specified,kilometerswill be used.steps(optional):INTnumber of steps. If not specified, the default value of64will be used.
Return type
VARCHAR(MAX)
Examples
ST_MAKEENVELOPE
Description Creates a rectangular Polygon from the minimum and maximum values for X and Y.
xmin:FLOAT8minimum value for X.ymin:FLOAT8minimum value for Y.xmax:FLOAT8maximum value for X.ymax:FLOAT8maximum value for Y.
Return type
GEOMETRY
Example
ST_TILEENVELOPE
Description Returns the boundary polygon of a tile given its zoom level and its X and Y indices.
zoomLevel:INTzoom level of the tile.xTile:INTX index of the tile.yTile:INTY index of the tile.
Return type
GEOMETRY
Example
Last updated
Was this helpful?
