Comunas de Chile

I struggled a lot to find a way to create (good) geojson files from a Postgis database. Today I found the answer and I hope this helps other people that are trying to do the same.

First, you have to create your Postgis spatial database. Here is an excellent article by Steve Gattuso on how to set this up: Now that you have your database, lets head to the main part of this article.

I used Python’s Pandas to store the query’s info and psycopg2 for the database connection. Feel free to use another Postgres database adapter.

In this…

Tomás Pérez

Engineering student specializing in Software Development. Currently working in Beetrack as a Data Scientist.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store