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)

Preparing data


Raster import was covered in Chapter 1, Importing Spatial Data, subject and exporting is on its way in the next chapter, so we can look strictly into vector <-> raster conversion and processing.

For our use case, we will use EU-DEM dataset, produced using Copernicus data and information funded by European Union - EU-DEM layers. It's one arc second model of the whole European Union (without overseas territories). With its open license, we can use it with no concerns. The dataset is accessible by http://www.eea.europa.eu/data-and-maps/data/eu-dem.

As a vector layer, we can use OpenStretMap data for the Poland and Czech Republic administrative units.

In the first step, let's import the dataset as we learned in Chapter 1, Importing Spatial Data. For optimization of import processes, look into metadata, for SRID and size of raster, gdalinfo makes it easy:

user@machine:~/dev/gis/dem$ gdalinfo eudem_dem_5deg_n45e015.tif 
Driver: GTiff/GeoTIFF 
Files: eudem_dem_5deg_n45e015.tif...