Having learned how to use PostGIS to derive added value from our spatial data, it is now time to explore ways of sharing our spatial assets with the outside world. In this chapter, we will focus on consuming PostGIS data in WebGIS applications. In order to expose the data, we will have a look at GeoServer, but we will also write some simple web services in Node.js.
In this chapter, we will have a look at:
- Outputting vector data as web services in GeoServer:
-
- Outputting vector data as WMS services in GeoServer
- Outputting raster data as WMS services in GeoServer
- Outputting vector data as WFS services
- Consuming WMS in ol3
- Consuming WMS in Leaflet
- Outputting and consuming GeoJSON
- Outputting and consuming TopoJSON
- Consuming WFS in ol3
- Implementing a simple CRUD application that demonstrates vector editing via web interfaces
All the WebGIS examples presented in this chapter are purposefully minimalistic. The point is not to create a fully featured web application, but rather to focus on the bits and pieces that clearly describe the topics presented and can be easily reused in other applications.
The UI library used for the examples is ExtJS - a RIA (Rich Interface Application) SDK available in both open source and commercial license flavors. You can obtain an open source license from here: https://www.sencha.com/legal/GPL/. An archive with a GPL version of the ExtJS 6.2 framework is also available in the chapter resources.
Code examples are meant to work straight away, so you should be able to simply drop the code into your web server directory and it should work without further setup. If you do not have the resources to use a web server, you can still run the examples by using the Sencha CMD tool. The ExtJS Hello World example describes how to use Sencha CMD without using a web server.