MeridianMERIDIAN

Well-Known Text Geometry

OGC Well-Known Text (WKT) representation of geometry objects. Strings begin with a geometry type keyword (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION) optionally followed by Z/M/ZM dimension suffix.

Well-Known Text Geometry

geography.format.wkt

OGC Well-Known Text (WKT) representation of geometry objects. Strings begin with a geometry type keyword (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION) optionally followed by Z/M/ZM dimension suffix.

Domain
geography
Category
format
Casts to
VARCHAR
Scope
Universal

Try it

CLI
$ finetype infer -i "POINT (30 10)"
→ geography.format.wkt

DuckDB

Detect
SELECT finetype('POINT (30 10)');
-- → 'geography.format.wkt'
Cast expression
CAST({col} AS VARCHAR)
Safe cast pipeline
-- Normalise and cast in one step
SELECT TRY_CAST(finetype_cast(my_column) AS VARCHAR) AS clean_value
FROM my_table
WHERE finetype(my_column) = 'geography.format.wkt';

JSON Schema

finetype schema geography.format.wkt
{
  "$id": "https://meridian.online/schemas/geography.format.wkt",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "OGC Well-Known Text (WKT) representation of geometry objects. Strings begin with a geometry type keyword (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION) optionally followed by Z/M/ZM dimension suffix.",
  "examples": [
    "POINT (30 10)",
    "LINESTRING (30 10, 10 30, 40 40)",
    "POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))",
    "MULTIPOINT ((10 40), (40 30), (20 20), (30 10))",
    "POINT EMPTY"
  ],
  "pattern": "^(POINT|LINESTRING|POLYGON|MULTI(POINT|LINESTRING|POLYGON)|GEOMETRYCOLLECTION)\\s*(Z|M|ZM)?\\s*(\\(|EMPTY)",
  "title": "Well-Known Text Geometry",
  "type": "string",
  "x-finetype-broad-type": "VARCHAR",
  "x-finetype-transform": "CAST({col} AS VARCHAR)",
  "x-finetype-transform-ext": "ST_GeomFromText({col})"
}

Examples

POINT (30 10)LINESTRING (30 10, 10 30, 40 40)POLYGON ((30 10, 40 40, 20 40, 10 20, 30 10))MULTIPOINT ((10 40), (40 30), (20 20), (30 10))POINT EMPTY

Aliases

well_known_text

Type Registry