GeoLeaf Core API - v3.0.0
    Preparing search index...
    • Converts a WKT geometry string to a GeoJSON geometry object.

      Supports all 7 standardised WKT geometry types (2D and 3D/Z): Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection.

      • SRID prefixes (e.g. SRID=4326;POINT(...)) are stripped before parsing.
      • WKT qualifier tokens (Z, M, ZM) are accepted and ignored.
      • Returns null when the input is null, empty, or syntactically invalid.
      • Never throws.

      Parameters

      • wkt: string | null | undefined

        WKT geometry string.

      Returns WktGeometry | null

      A GeoJSON geometry object, or null on failure.

      wktToGeoJSON("POINT(2.3522 48.8566)")
      // → { type: "Point", coordinates: [2.3522, 48.8566] }

      wktToGeoJSON("POINT Z (2.3522 48.8566 35)")
      // → { type: "Point", coordinates: [2.3522, 48.8566, 35] }