Skip to Content
PostGIS Cookbook - Second Edition
book

PostGIS Cookbook - Second Edition

by Stephen Vincent Mather, Pedro Wightman, Bborie Park, Thomas Kraft, Mayra Zurbarán, Paolo Corti
March 2018
Beginner to intermediate content levelBeginner to intermediate
584 pages
14h 31m
English
Packt Publishing
Content preview from PostGIS Cookbook - Second Edition

How it works...

Psycopg is the most popular PostgreSQL adapter for Python, and it can be used to create Python scripts that send SQL commands to PostGIS. In this recipe, you created a Python script that queries weather data from the https://openweathermap.org/ web server using the popular JSON format to get the output data and then used that data to update two PostGIS layers.

For one of the layers, cities, the weather data is used to update the temperature field using the temperature data of the weather station closest to the city. For this purpose, you used an UPDATE SQL command. The other layer, wstations, is updated every time a new weather station is identified from the weather data and inserted in the layer. In this case, you used an ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

PostgreSQL 13 Cookbook

PostgreSQL 13 Cookbook

Vallarapu Naga Avinash Kumar
PostgreSQL High Performance Cookbook

PostgreSQL High Performance Cookbook

Dinesh Kumar, Chitij Chauhan
Mastering PostGIS

Mastering PostGIS

Dominik Mikiewicz, Michal Mackiewicz, Tomasz Nycz

Publisher Resources

ISBN: 9781788299329Supplemental Content