st_castToLineString
LineString st_castToLineString(Geometry g)
This function casts Geometry g to a LineString.
Example:
- Query command:
select st_astext(st_castToLineString(st_geomFromWKT(location))) from geotbl where id='5'
- The query result is as follows:
LINESTRING (30 10, 40 40, 20 40, 10 20, 30 10)
st_castToPoint
Point st_castToPoint(Geometry g)
This function casts Geometry g to a Point.
Example:
st_castToPolygon
Polygon st_castToPolygon(Geometry g)
This function casts Geometry g to a polygon.
Example:
- Query command:
select st_astext(st_castToPolygon(st_geomFromWKT(location))) from geotbl where id='1'
- The query result is as follows:
POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))
st_byteArray
Array[Byte] st_byteArray(String s)
This function encodes strings into an array of bytes using the UTF-8 charset.
Example:
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.