17 Using PostGIS in web applications

 

This chapter covers

  • Shortcomings of conventional web solutions
  • Pg_tileserv and pg_featureserv
  • MapServer, GeoServer, QGIS Server
  • OpenLayers 6, Leaflet 1
  • Displaying data with PostGIS queries and web scripting

In a span of 30 years, the World Wide Web has emerged as the leading method of information delivery, largely replacing printed media. For GIS, this has been a godsend. Not only did the web introduce GIS to the popular imagination, but it also provided a delivery mechanism for GIS data that wouldn’t have been possible via traditional printed media. In the past a GIS practitioner wishing to share data would have had to print out large maps on oversized printers or send copies of data on disk media. And then came the web.

Conventional web technologies suffice to deliver textual and image data, but for the ultimate GIS web-surfing experience, you need additional tools, both on the delivery end (the server) and on the receiving end (the client).

Quite recently, with the advent of PostGIS Mapbox Vector Tiles (MVT) support and the richer PostgreSQL/PostGIS JSON support, both detailed in chapter 8, many more people are discovering the freedom of being able to expose data directly from their database stored functions, queries, and tables with minimal middleware.

17.1 Limitations of conventional web technologies

17.2 Mapping servers

17.2.1 Lightweight mapping servers

17.2.2 Full mapping servers

17.3 Mapping clients

17.3.1 Proprietary services

17.4 Using MapServer

17.4.1 Installing MapServer

17.4.2 Security considerations

17.4.3 Creating WMS and WFS services

17.4.4 Calling a mapping service using a reverse proxy

17.5 Using GeoServer

17.6.1 OpenLayers primer