ST_COORDDIM
Alias for ST_NDIMS or ST_NDIMENSION. Returns anINTEGER of the coordinate dimension of the specified geography.
Syntax
SQL
Example
SQL
2
ST_DIMENSION
Returns anINTEGER that represents the dimension of the specified geography. This table describes the result values of the ST_DIMENSION function.
The
ST_DIMENSION function always returns 0 for non-empty POINT objects.
For non-empty LINESTRING and POLYGON objects, the ST_DIMENSION function returns the dimension value equal to the greatest dimension represented by their bounding points. For example, a LINESTRING or POLYGON object that contains only a single point returns 0. Similarly, a POLYGON object can return 1 if it contains insufficient points to represent a closed polygon.
Syntax
SQL
Examples
In this example, the function evaluates a
LINESTRING with an empty POINT value.
SQL
-1
In this example, the function evaluates a LINESTRING with a single POINT value.
SQL
0
This example evaluates an empty LINESTRING.
SQL
-1
In this example, the function again evaluates a LINESTRING with a single POINT value.
SQL
0
In this example, the function evaluates a LINESTRING with multiple POINT values.
SQL
1
This example evaluates an empty POLYGON.
SQL
-1
This example evaluates a POLYGON with a single POINT.
SQL
0
This example evaluates a POLYGON with two POINT values.
SQL
1
This example evaluates a POLYGON with multiple POINT values, enough to close the POLYGON.
SQL
2
ST_GEOMETRYTYPE
Returns aSTRING that represents the geometry of the input geospatial value. Supported values are ST_POINT, ST_LINESTRING, and ST_POLYGON. This function enforces the same strict dimension types as the ST_DIMENSION function. If geo is NULL, then the function returns NULL.
Syntax
SQL
Example
SQL
ST_POINT
ST_ISEMPTY
ReturnsTRUE if the specified geography value is empty, such as 'POLYGON EMPTY'. A NULL input value returns NULL.
Syntax
SQL
Example
SQL
TRUE
ST_MEMSIZE
Returns anINTEGER representing the number of bytes in memory required to store the specified geography.
Syntax
SQL
Example
SQL
16
ST_NDIMS or ST_NDIMENSION
Alias for ST_COORDDIM.ST_NPOINTS or ST_NUMPOINTS
Returns anINTEGER representing the number of POINT values in a specified geography.
If the specified value is a POLYGON, this function counts the number of POINT values in both the exterior and any holes.
Syntax
SQL
SQL
Example
SQL
3
ST_SRID
Returns the EPSG code of the spatial reference identifier (SRID) of the input geography. All geographies are of type GCS WGS 84, which is identified by the value 4326. There is no way to set a different SRID. SyntaxSQL
Example
SQL
4326
ST_X
Returns the x value, or longitude, of the specifiedPOINT. The returned value is a DOUBLE type.
Syntax
SQL
Example
SQL
3
ST_XMAX
Returns the maximum x value of the specified geography. The returned value is aDOUBLE type.
Syntax
SQL
Example
In this example, the
ST_XMAX function returns 2 because it is the largest x value of the specified points.
SQL
2
ST_XMIN
Returns the minimum x value of the specified geography. SyntaxSQL
Example
In this example, the
ST_XMIN function returns 0 because it is the smallest x value of the specified points.
SQL
0
ST_Y
Returns the y value, or latitude, of the specifiedPOINT. The returned value is a DOUBLE type.
Syntax
SQL
Example
SQL
5
ST_YMAX
Returns the maximum y value of the specified geography. SyntaxSQL
Example
In this example, the
ST_YMAX function returns 5 because it is the largest y value of the specified points.
SQL
5
ST_YMIN
Returns the minimum y value of the specified geography. SyntaxSQL
Example
In this example, the
ST_YMIN function returns 2 because it is the smallest y value of the specified points.
SQL
2

