Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying PostGIS Cookbook
  • Table Of Contents Toc
PostGIS Cookbook

PostGIS Cookbook

By : Paolo Corti, Bborie Park
4.6 (12)
close
close
PostGIS Cookbook

PostGIS Cookbook

4.6 (12)
By: Paolo Corti, Bborie Park

Overview of this book

An easy-to-use guide, full of hands-on recipes for manipulating spatial data in a PostGIS database. Each topic is explained and placed in context, and for the more inquisitive, there are more details of the concepts used. If you are a web developer or a software architect, especially in location-based companies, and want to expand the range of techniques you are using with PostGIS, then this book is for you. You should have some prior experience with PostgreSQL database and spatial concepts.
Table of Contents (13 chapters)
close
close
12
Index

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/.)

You will also generate a new PostGIS layer with the 10 closest weather stations to each city.

Getting ready

  1. Create a database schema for the recipes in this chapter using the following command:

    postgis_cookbook=# CREATE SCHEMA chp08;
    
  2. Download the...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
PostGIS Cookbook
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon