Book Image

Mastering PostGIS

By : Dominik Mikiewicz, Michal Mackiewicz , Tomasz Nycz
Book Image

Mastering PostGIS

By: Dominik Mikiewicz, Michal Mackiewicz , Tomasz Nycz

Overview of this book

PostGIS is open source extension onf PostgreSQL object-relational database system that allows GIS objects to be stored and allows querying for information and location services. The aim of this book is to help you master the functionalities offered by PostGIS- from data creation, analysis and output, to ETL and live edits. The book begins with an overview of the key concepts related to spatial database systems and how it applies to Spatial RMDS. You will learn to load different formats into your Postgres instance, investigate the spatial nature of your raster data, and finally export it using built-in functionalities or 3th party tools for backup or representational purposes. Through the course of this book, you will be presented with many examples on how to interact with the database using JavaScript and Node.js. Sample web-based applications interacting with backend PostGIS will also be presented throughout the book, so you can get comfortable with the modern ways of consuming and modifying your spatial data.
Table of Contents (9 chapters)

Retrieving and processing JSON data


Let's imagine our company provides data services for local governments. The company does not own or generate data; its services are mainly based on aggregating data from external sources and providing them in a digested form. One of the services offered is based on weather data, and provides early alerts when weather forecasts extend certain configured parameters.

In this example, we will simulate services for Polish local government and use the following data sources:

  • The third level of administrative boundaries of Poland
  • OpenWeatherMap data services

The administrative boundaries simulate our own data source from which we will be generating weather alerts, while OpenWeatherMap is a weather data service provider.

Importing shapefiles revisited

Let's first prepare our company database. In order to do so, we first need to obtain the boundaries of the administrative divisions of Poland. The official data can be downloaded from http://www.codgik.gov.pl/index.php...