ST_LENGTH (Lakehouse v1)
Devolve o comprimento euclidiano das LineString de um objeto GEOMETRY.
Sintaxe SQL
Seção intitulada “Sintaxe SQL”ST_LENGTH(<geometry>)Argumentos
Seção intitulada “Argumentos”| Argumentos | Descrição |
|---|---|
<geometry> |
O argumento tem de ser uma expressão do tipo GEOMETRY que contenha linestrings. |
Tipo de retorno
Seção intitulada “Tipo de retorno”Double.
Exemplos de SQL
Seção intitulada “Exemplos de SQL”SELECT ST_LENGTH(TO_GEOMETRY('POINT(1 1)')) AS length
┌─────────┐│ length │├─────────┤│ 0 │└─────────┘
SELECT ST_LENGTH(TO_GEOMETRY('LINESTRING(0 0, 1 1)')) AS length
┌─────────────┐│ length │├─────────────┤│ 1.414213562 │└─────────────┘
SELECT ST_LENGTH( TO_GEOMETRY('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))') ) AS length
┌─────────┐│ length │├─────────┤│ 0 │└─────────┘