WKT to Shapefile Converter
The handoff step from a spatial-SQL pipeline to a GIS analyst who lives in ArcGIS or QGIS.
Common issues converting WKT to Shapefile
- One WKT statement per line; mixed geometry types in one file are bucketed by dominant type. Only the dominant bucket lands in the Shapefile.
- WKT has no attributes — the resulting DBF has only a row index column. Provide attributes via a parallel CSV joined by row order, or use Shapefile-with-attributes target alternatives.
- SRID=... prefix (EWKT) is accepted but only as metadata — the converter assumes WGS 84 and emits a WGS 84 .prj. Reproject pre-conversion if your source is in a different CRS.
- POLYGON ring orientation in WKT (OGC: outer CCW) is flipped to ESRI convention (outer CW) on emit. The shape is identical; only the winding differs.
Frequently asked questions
Why doesn't the output have my PostGIS attributes?
WKT carries geometry only. Run a `SELECT ST_AsText(geom), * FROM table` and process the attributes separately, then join post-conversion.
Are MULTIPOLYGON rings nested correctly?
Yes — outer rings with their holes are preserved. Output uses ESRI's CW-outer / CCW-hole convention.
What about GEOMETRYCOLLECTION?
Shapefile doesn't support mixed-type geometry, so a GEOMETRYCOLLECTION is dropped with a warning. Split your WKT into per-type files first.
Does the .prj declare WGS 84 or something else?
WGS 84 by default. Use the CRS parameter to specify a different output projection — the converter will reproject before emit.