Computes the perimeter of the multi-surface in the specified units.
multisurface-expression.ST_Perimeter([ unit-name])
Name | Type | Description |
---|---|---|
unit-name |
VARCHAR(128) |
The units in which the perimeter should be computed. Defaults to the unit of the spatial reference system. The unit name must match the UNIT_NAME column of a row in the ST_UNITS_OF_MEASURE view where UNIT_TYPE is 'LINEAR'. |
DOUBLE Returns the perimeter of the multi-surface.
The ST_Perimeter method returns the length of the perimeter of a multi-surface in the units identified by the unit-name parameter. If the multi-surface is empty, then NULL is returned.
If the multi-surface contains Z values, these are not considered when computing the perimeter of the geometry.
The perimeter of a polygon includes the length of all rings (exterior and interior).
If the multisurface-expression is an empty geometry (ST_IsEmpty()=1), then this method returns NULL.
By default, ST_Perimeter uses the original format for a geometry, if it is available. Otherwise, the internal format is used. For more information about internal and original formats, see STORAGE FORMAT clause, CREATE SPATIAL REFERENCE SYSTEM statement.
SQL/MM (ISO/IEC 13249-3: 2006) 9.5.4
The following example creates a multi-surface containing two polygons and uses ST_Perimeter to find the length of the perimeter,
returning the result 44
.
SELECT NEW ST_MultiSurface( NEW ST_Polygon('Polygon((0 0, 1 0, 1 1,0 1, 0 0))') , NEW ST_Polygon('Polygon((10 10, 20 10, 20 20,10 20, 10 10))') ) .ST_Perimeter() |
The following example creates a multi-surface containing two polygons and an example unit of measure (example_unit_halfmetre). The ST_Perimeter method finds the length of the perimeter, returning the value 88.0.
CREATE SPATIAL UNIT OF MEASURE IF NOT EXISTS "example_unit_halfmetre" TYPE LINEAR CONVERT USING .5; SELECT NEW ST_MultiSurface( NEW ST_Polygon('Polygon((0 0, 1 0, 1 1,0 1, 0 0))') , NEW ST_Polygon('Polygon((10 10, 20 10, 20 20,10 20, 10 10))') ) .ST_Perimeter('example_unit_halfmetre'); |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |