Skip to content

ST_PointFromText

Constructs a Point from Well-Known Text (WKT), erroring if the input is not a Point.

Usage

geometry ST_PointFromText(wkt: string)
geometry ST_PointFromText(wkt: string, srid: crs)

Arguments

  • wkt (string)
  • srid (crs)

Description

Parses a WKT string and returns a geometry. Raises an error if the WKT does not represent a Point.

Examples

SELECT ST_PointFromText('POINT (30 10)');
┌─────────────────────────────────────────┐
│ st_pointfromtext(Utf8("POINT (30 10)")) │
│                 geometry                │
╞═════════════════════════════════════════╡
│ POINT(30 10)                            │
└─────────────────────────────────────────┘

With an SRID or CRS:

SELECT ST_PointFromText('POINT (30 10)', 4326);
┌─────────────────────────────────────────────────────┐
│ st_pointfromtext(Utf8("POINT (30 10)"),Int64(4326)) │
│                       geometry                      │
╞═════════════════════════════════════════════════════╡
│ POINT(30 10)                                        │
└─────────────────────────────────────────────────────┘