Gathering reports from the field
In our final example in this chapter, we’ll get off the bus and out into the field. Smartphones, tablets, and laptops allow us to update a GIS and view those updates from anywhere. We’ll use HTML, GeoJSON, the Leaflet
JavaScript library, and a pure-Python library named Folium
to create a client-server application that allows us to post geospatial information to a server and then create an interactive web map to view those data updates.
First, we need a web form that shows your current location and updates the server when you submit the form with comments about your location. You can find the form here: http://geospatialpython.github.io/Learn/LGAWPFieldWork.html.
The following screenshot shows the form:
Figure 10.4 – Field data collection form
You can view the source of that form to see how it works. The mapping is done using the Leaflet
library and posts GeoJSON to a unique URL on jsonbin.io....