Convert Multiple WKT Geometries to GeoJSON
A single-geometry converter is the wrong shape for the common case: a SELECT ST_AsText(geom) that returned hundreds of rows. Pasting the whole column here produces one GeoJSON FeatureCollection, which is what Leaflet, Mapbox and OpenLayers actually want to consume. Mixed geometry types in the same list are fine.
SQL & Code Example
How to perform this conversion directly in your PostgreSQL / PostGIS database:
-- The query whose output this page expects SELECT ST_AsText(ST_Transform(geom, 4326)) FROM parcels WHERE district = 'Miraflores';
Frequently Asked Questions
Can I mix points, lines and polygons in one paste?+
Yes. A GeoJSON FeatureCollection can hold any combination of geometry types, and each line is parsed independently.
What happens to lines that are not valid WKT?+
They are skipped rather than failing the whole batch, so one malformed row does not cost you the other several hundred.
Is there a row limit?+
There is no hard limit — the conversion runs in your browser, so the practical ceiling is your machine’s memory rather than a server quota.
WKT Geometry Reference
Not sure your input is valid? Each geometry type has its own page with syntax rules, the mistake that most often breaks it, and PostGIS and Shapely recipes.