Skip to content

Construct a spatial geometric entity and convert a spatial geometric entity into the WKT format

Use the ST_GeometryFromText( 'multipolygon (((10 10, 10 20, 20 20, 20 15 , 10 10), (50 40, 50 50, 60 50, 60 40, 50 40)))') function to construct a spatial geometric entity. Use the ST_AsText(ST_Point(1, 1)) function to convert a spatial geometric entity into the WKT format. The results are displayed in a table.

SQL
|
SELECT
  ST_GeometryFromText(
    'multipolygon (((10 10, 10 20, 20 20, 20 15 , 10 10), (50 40, 50 50, 60 50, 60 40, 50 40)))'
  ) as "Spatial geometric entity",
  ST_AsText(ST_Point(1, 1)) as "Convert a spatial geometric entity into the WKT format"