Export GeoJSON from PostgreSQL using Beekeeper Studio
Query > Download > Copy > Paste!
Beekeeper Studio is an open source SQL editor written in NodeJS and Vue JS. The UI is clean and simple, and it has just the right amount of tools to get the job done. The query interface even has a handy Download button to export the results of a query. Using the Copy to Clipboard Copy Cell option we can extract GeoJSON directly from a PostGIS enabled PostgreSQL database to a computer without having to open QGIS or another GIS desktop or command-line tool.
- Open Beekeeper Studio and copy the following query, replacing your_table with your table name, and changing the geom fields and id field if need be.
|
- After the script runs, use the
DownloadCopy Cell option by right-clicking on the returned data to copy the contents to the clipboard. - Open a text editor such as VS Code and paste the data.
Use the Home button to go to the beginning of the text and delete “jsonb_build_object”.- Save the result as a .geojson file.