O'Reilly logo

PostGIS Cookbook by Bborie Park, Stephen Vincent Mather, Thomas J. Kraft, Paolo Corti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Writing PostGIS vector data with Psycopg

In this recipe, you will use Python combined with Psycopg, the most popular PostgreSQL database library for Python, in order to write some data to PostGIS using the SQL language.

You will write a procedure to import weather data for the most populated US cities. You will import such weather data from OpenWeatherData.org, which is a web service that provides free weather data and forecast API. The procedure you are going to write will iterate each major USA city and get the actual temperature for it from the closest weather stations using the OpenWeatherData.org Web service API, getting the output in the JSON format. (In case you are new to the JSON format, you can find details about it at http://www.json.org/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required