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)

Consuming WFS in ol3


Leaflet does not read WFS, so our WFS example will be OpenLayers only. Consuming WFS means reading, retrieving, and rendering vector data on the client side. Such processes may be intensive on PC resources - we will therefore use a rather small dataset with the ne_reefs vector so we do not have to bother with performance issues when dealing with larger vector datasets.

Note

There are different techniques for dealing with large datasets, such as the bounding box strategy, mixing WMS for smaller scales, displaying with WFS for larger scale display, and using vector tiles. Those are not specific to the data source as such, and therefore I will not elaborate on the subject.

Our web example will be very similar to the previous one with WMS only. The different part is the layers declaration:

createLayers: function(){ 
    var proj = ol.proj.get('EPSG:4326'); 
        format = new ol.format.WFS(), 
        wfsVectorSource = new ol.source.Vector({ 
            projection: proj,...