measurements
This module contains functions that compute measurements of distance, area and angles. There are also functions to compute geometry values determined by measurements.
ST_ANGLE
ST_ANGLE(startPoint, midPoint, endPoint, mercator)Description
Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise) angle with origin on the startPoint-midPoint segment, or its explementary angle if required.
- startPoint:- GEOGRAPHYstart Point Coordinates.
- midPoint:- GEOGRAPHYmid Point Coordinates.
- endPoint:- GEOGRAPHYend Point Coordinates.
- mercator:- BOOLEAN|- NULLif calculations should be performed over Mercator or WGS84 projection. If- NULLthe default value- falseis used.
Return type
FLOAT64
Example
SELECT `carto-un`.carto.ST_ANGLE(ST_GEOGPOINT(-3.70325 ,40.4167), ST_GEOGPOINT(-4.70325 ,10.4167), ST_GEOGPOINT(-5.70325 ,40.4167), false);
-- 3.933094586038578SELECT `carto-un-eu`.carto.ST_ANGLE(ST_GEOGPOINT(-3.70325 ,40.4167), ST_GEOGPOINT(-4.70325 ,10.4167), ST_GEOGPOINT(-5.70325 ,40.4167), false);
-- 3.933094586038578SELECT carto.ST_ANGLE(ST_GEOGPOINT(-3.70325 ,40.4167), ST_GEOGPOINT(-4.70325 ,10.4167), ST_GEOGPOINT(-5.70325 ,40.4167), false);
-- 3.933094586038578ST_MINKOWSKIDISTANCE
ST_MINKOWSKIDISTANCE(geog, p)Description
Calculate the Minkowski p-norm distance between two features.
- geog:- ARRAY<GEOGRAPHY>featureCollection.
- p:- FLOAT64minkowski p-norm distance parameter. 1: Manhattan distance. 2: Euclidean distance. 1 =< p <= infinity. If- NULLthe default value- 2is used.
Return type
ARRAY<STRING>
Example
SELECT `carto-un`.carto.ST_MINKOWSKIDISTANCE([ST_GEOGPOINT(10,10),ST_GEOGPOINT(13,10)],2);
-- ["0,0.3333333333333333","0.3333333333333333,0"]SELECT `carto-un-eu`.carto.ST_MINKOWSKIDISTANCE([ST_GEOGPOINT(10,10),ST_GEOGPOINT(13,10)],2);
-- ["0,0.3333333333333333","0.3333333333333333,0"]SELECT carto.ST_MINKOWSKIDISTANCE([ST_GEOGPOINT(10,10),ST_GEOGPOINT(13,10)],2);
-- ["0,0.3333333333333333","0.3333333333333333,0"] This project has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement No 960401.
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?
