Geometry Constructors
The geometry constructors can be used to create a Geometry using the well-known binary (WKB) representation, well-known text (WKT) representation, or Geohash.
st_geomFromGeoHash
Geometry st_geomFromGeoHash(String geohash, Int prec)
This function returns the Geometry of the bounding box corresponding to the Geohash string geohash (base-32 encoded) with the precision of prec bits. For more information about Geohash, see Geohash.
Example:
st_box2DFromGeoHash
Geometry st_box2DFromGeoHash(String geohash, Int prec)
Alias for st_geomFromGeoHash. Refer to the example in st_geomFromGeoHash.
st_geomFromWKB
Geometry st_geomFromWKB(Array[Byte] wkb)
This function creates a Geometry from the given WKB.
Example:
st_geomFromWKT
Geometry st_geomFromWKT(String wkt)
This function creates a Geometry from the given WKT.
st_geomFromText
Geometry st_geomFromText(String wkt)
Alias for st_geomFromWKT.
Example:
st_geometryFromText(String wkt)
Geometry st_geometryFromText(String wkt)
Alias for st_geomFromWKT.
Example:
st_lineFromText
LineString st_lineFromText(String wkt)
This function creates a LineString from the given WKT representation.
Example:
st_mLineFromText
MultiLineString st_mLineFromText(String wkt)
This function creates a MultiLineString corresponding to the given WKT representation.
Example:
st_mPointFromText
MultiPoint st_mPointFromText(String wkt)
This function creates a MultiPoint corresponding to the given WKT representation.
Example:
st_mPolyFromText
MultiPolygon st_mPolyFromText(String wkt)
This function creates a MultiPolygon corresponding to the given WKT representation.
Example:
st_makeBBOX
Geometry st_makeBBOX(Double lowerX, Double lowerY, Double upperX, Double upperY)
This function creates a Geometry representing a bounding box with the given boundaries.
Example:
st_makeBox2D
Geometry st_makeBox2D(Point lowerLeft, Point upperRight)
This function creates a Geometry representing a bounding box defined by the given points.
Example:
st_makePoint
Point st_makePoint(Double x, Double y)
This function creates a point with x and y coordinates.
Example:
st_makePointM
Point st_makePointM(Double x, Double y, Double m)
This function creates a point with x, y, and m coordinates.
Example:
st_makePolygon
Polygon st_makePolygon(LineString shell)
This function creates a Polygon formed by the given LineString shell, which must be closed.
Example:
st_point
Point st_point(Double x, Double y)
This function creates a point with the given coordinate values. This is an OGC alias for st_makePoint.
Example:
st_pointFromGeoHash
Point st_pointFromGeoHash(String geohash, Int prec)
This function creates the point at the geometric center of the bounding box defined by the Geohash string geohash (base-32 encoded) with the precision of prec bits. For more information about Geohash, see Geohash.
Example:
st_pointFromText
Point st_pointFromText(String wkt)
This function creates a point corresponding to the given WKT representation.
Example:
st_pointFromWKB
Point st_pointFromWKB(Array[Byte] wkb)
This function creates a point corresponding to the given WKB representation.
Example:
st_polygon
Polygon st_polygon(LineString shell)
This function creates a Polygon formed by the given LineString shell, which must be closed.
Example:
st_polygonFromText
Polygon st_polygonFromText(String wkt)
This function creates a polygon corresponding to the given WKT representation.
Example:
Last Article: Preparing for Geometry Query
Next Article: Geometry Accessors
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.