GeoJSON to WKT Converter
Loads GeoJSON data into a spatial database by producing WKT strings suitable for ST_GeomFromText().
Common issues converting GeoJSON to WKT
- The output is plain WKT, one geometry per line. Wrap with ST_SetSRID(ST_GeomFromText(...), 4326) in SQL, or prepend 'SRID=4326;' per line to get EWKT.
- Feature properties are not included — you only get geometries. If you need attributes alongside, produce a CSV with a WKT column via GeoJSON→CSV instead.
- 3D GeoJSON coordinates emit POINT Z / LINESTRING Z etc., following OGC rules. Databases handle these fine in modern versions.
- GeometryCollections map directly to WKT GEOMETRYCOLLECTION, but many database functions reject collections — prefer splitting before ingest.
Frequently asked questions
What's the output format exactly?
A plain text file with one WKT geometry per line, in the same order as the input features. Each line is a standalone geometry string ready for ST_GeomFromText().
Can I include the SRID in the output?
The default is plain WKT without SRID. Prepend 'SRID=4326;' per line in a text editor for PostGIS, or wrap with ST_SetSRID(ST_GeomFromText(x), 4326) in SQL.
Do feature properties come along?
No — you only get geometries. For properties plus geometry per row, use GeoJSON→CSV, which can emit a WKT column.
Are GeometryCollections supported?
Yes, mapped to WKT GEOMETRYCOLLECTION. Be aware that many DB functions reject collections — split into typed geometries before ingest if possible.