Conversion Functions
OcientGeo™ conversion functions transform a specified operand to a different data type.
ST_ASBINARY
Alias of ST_ASWKB.
Returns the well-known binary (WKB) representation of the specified geography.
Syntax
Example
Output: 010100000000000000000000400000000000000040
ST_ASGEOJSON
Returns the GeoJSON representation of the specified geography using the IETF standards.
Examples
This example converts a POINT value into a GeoJSON representation.
Output:
This example converts an empty POINT value.
Output:
This example converts a LINESTRING value into a GeoJSON representation.
Output:
This example again converts a LINESTRING value.
Output:
This example converts an empty LINESTRING value into a GeoJSON representation.
Output:
This example converts a POLYGON value into a GeoJSON representation.
Output:
This example again converts a POLYGON value.
Output:
This example converts a two-point POLYGON, which results in a LINESTRING type in the GeoJSON representation.
Output:
This example converts a single-point POLYGON, which results in a POINT type in the GeoJSON representation.
Output:
This example converts an empty POLYGON value into a GeoJSON representation.
Output:
ST_ASLATLONTEXT
Returns a string that represents geographic coordinates of a specified POINT in the specified format.
Example
Output: '2.0 degrees 19.50 minutes S 10.0 degrees 14.05 minutes E'
ST_ASTEXT
Alias of ST_ASWKT and ST_EWKT.
Returns the well-known text (WKT) representation of the specified geography.
If you use ST_ASEWKT, the database prepends the resultant string with SRID=4326;.
Example
Output: POLYGON((1 2, 1 3, 1 3, 1 2))
ST_ASEWKT
For usage, see ST_ASTEXT.
ST_ASWKT
Alias of ST_ASTEXT.
ST_ASWKB
Alias of ST_ASBINARY.
ST_GEOHASH
Returns a string that represents the geohash of the input POINT. This function also accepts an optional second argument to specify the length of the geohash result.
If you specify any argument as NULL, then the function returns NULL.
Example
Output: c0w3hc0w3hf1s70w3hf1s70w3

