EWKT

更新时间:
复制 MD 格式

Extended Well-Known Text (EWKT) extends the standard Well-Known Text (WKT) format by adding a spatial reference identifier (SRID) and an optional SOLID flag. PolarDB for PostgreSQL uses EWKT for spatial data that carries coordinate reference system metadata.

Segments in an EWKT string are separated by semicolons (;).

Syntax

An EWKT string follows this structure:

SRID=<srid>;<geometry-type>(<coordinates>)

To include the SOLID flag:

SRID=<srid>;SOLID=true;<geometry-type>(<coordinates>)

Key components

ComponentDescription
SRIDThe spatial reference identifier that specifies the coordinate reference system.
SOLIDAn optional boolean flag. Set to true to mark the geometry as a solid (closed volumetric shape).
Geometry typeThe geometry keyword, such as MESHGEOM, followed by coordinate data enclosed in parentheses.

Examples

The following examples use the MESHGEOM geometry type.

EWKT with SRID only:

SRID=4326;MESHGEOM(PATCH(INDEXSURFACE M(VERTEX(0 0 1,0 10 2,10 10 3,10 0 4), INDEX((0,1,2),(1,2,3)))))

EWKT with SRID and SOLID flag:

SRID=4326;SOLID=true;MESHGEOM(PATCH(INDEXSURFACE M(VERTEX(0 0 1,0 10 2,10 10 3,10 0 4), INDEX((0,1,2),(1,2,3)))))