3 ms·
I worked on a Django project recently where we were generating GeoJSON from data in a PostgreSQL table. We investigated using tricks like this to generate the
by simonw 5y ago
I worked on a Django project recently where we were generating GeoJSON from data in a PostgreSQL table.
We investigated using tricks like this to generate the JSON directly from a SQL query - my notes here: https://til.simonwillison.net/postgresql/constructing-geojson-in-postgresql https://til.simonwillison.net/postgresql/constructing-geojso...
The performance was a big enough improvement that, had we been bottlenecked on this particular operation, we would have shipped this (I'm afraid I don't have notes on benchmarks).
We only decided not to ship it because of concerns about the ongoing maintenance overhead, since we had other Python code generating GeoJSON that we would have still used - so we would have ended up maintaining multiple implementations.