A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/functions/st_perimeter below:

Website Navigation


ST_PERIMETER | Snowflake Documentation

ST_PERIMETER

Returns the length of the perimeter of the polygon(s) in a GEOGRAPHY or GEOMETRY object.

Syntax
ST_PERIMETER( <geography_or_geometry_expression> )

Copy

Arguments
geography_or_geometry_expression

The argument must be of type GEOGRAPHY or GEOMETRY.

Returns

Returns a REAL value, which represents the length:

Usage notes Examples GEOGRAPHY examples

This calculates the length of the perimeter of a polygon that is one degree of arc on each edge and has one edge on the equator:

SELECT ST_PERIMETER(TO_GEOGRAPHY('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'));
+------------------------------------------------------------------+
| ST_PERIMETER(TO_GEOGRAPHY('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))')) |
|------------------------------------------------------------------|
|                                                 444763.468727621 |
+------------------------------------------------------------------+

Copy

GEOMETRY examples

The following example demonstrates how to use the ST_PERIMETER function.

SELECT ST_PERIMETER(g), ST_ASWKT(g)
FROM (SELECT TO_GEOMETRY(column1) AS g
  FROM VALUES ('POINT(1 1)'),
              ('LINESTRING(0 0, 1 1)'),
              ('POLYGON((0 0, 0 1, 1 1, 1 0, 0 0))'));

Copy

+-----------------+--------------------------------+
| ST_PERIMETER(G) | ST_ASWKT(G)                    |
|-----------------+--------------------------------|
|               0 | POINT(1 1)                     |
|               0 | LINESTRING(0 0,1 1)            |
|               4 | POLYGON((0 0,0 1,1 1,1 0,0 0)) |
+-----------------+--------------------------------+

Copy


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4