For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.

Input parameters

  • startPoint: GEOGRAPHY start Point Coordinates.

  • midPoint: GEOGRAPHY mid Point Coordinates.

  • endPoint: GEOGRAPHY end Point Coordinates.

  • mercator: BOOL|NULL if calculations should be performed over Mercator or WGS84 projection. If NULL the default value false is 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.933094586038578
SELECT `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.933094586038578
SELECT carto.ST_ANGLE(ST_GEOGPOINT(-3.70325 ,40.4167), ST_GEOGPOINT(-4.70325 ,10.4167), ST_GEOGPOINT(-5.70325 ,40.4167), FALSE);
-- 3.933094586038578

ST_MINKOWSKIDISTANCE

Description

Calculate the Minkowski p-norm distance between two features.

Input parameters

  • geog: ARRAY<GEOGRAPHY> featureCollection.

  • p: FLOAT64 minkowski p-norm distance parameter. 1: Manhattan distance. 2: Euclidean distance. 1 =< p <= infinity. If NULL the default value 2 is used.

Return type

ARRAY<STRING>

Example

EU flagThis 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?