constructors
This module contains functions that create new geographies from coordinates or already existing geographies.
ST_BEZIERSPLINE
ST_BEZIERSPLINE(geog, 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:GEOGRAPHYinput LineString.resolution:INT64|NULLtotal time in milliseconds assigned to the line. IfNULLthe default value10000is used. 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:FLOAT64|NULLa measure of how curvy the path should be between splines. IfNULLthe default value0.85is used.
Example
SELECT `carto-un`.carto.ST_BEZIERSPLINE(
ST_GEOGFROMTEXT(
"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)"
),
10000,
0.9
);
-- LINESTRING(-76.091308 18.427501, -76.0916216712943 ...SELECT `carto-un-eu`.carto.ST_BEZIERSPLINE(
ST_GEOGFROMTEXT(
"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)"
),
10000,
0.9
);
-- LINESTRING(-76.091308 18.427501, -76.0916216712943 ...SELECT carto.ST_BEZIERSPLINE(
ST_GEOGFROMTEXT(
"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)"
),
10000,
0.9
);
-- LINESTRING(-76.091308 18.427501, -76.0916216712943 ...ST_MAKEELLIPSE
Description
Takes a Point and calculates the ellipse polygon given two semi-axes expressed in variable units and steps for precision.
center:GEOGRAPHYcenter point.xSemiAxis:FLOAT64semi (major) axis of the ellipse along the x-axis.ySemiAxis:FLOAT64semi (minor) axis of the ellipse along the y-axis.angle:FLOAT64|NULLangle of rotation (along the horizontal axis), from East in decimal degrees, positive clockwise. IfNULLthe default value0is used.units:STRING|NULLunits of length, the supported options are: miles, kilometers, and degrees. IfNULLthe default valuekilometersis used.steps:INT64|NULLnumber of steps. IfNULLthe default value64is used.
Example
ST_MAKEENVELOPE
Description Creates a rectangular Polygon from the minimum and maximum values for X and Y.
xmin:FLOAT64minimum value for X.ymin:FLOAT64minimum value for Y.xmax:FLOAT64maximum value for X.ymax:FLOAT64maximum value for Y.
Return type
GEOGRAPHY
Example
ST_TILEENVELOPE
Description Returns the boundary polygon of a tile given its zoom level and its X and Y indices.
zoomLevel:INT64zoom level of the tile.xTile:INT64X index of the tile.yTile:INT64Y index of the tile.
Return type
GEOGRAPHY
Example
This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 960401.
Last updated
Was this helpful?
