Live Web Maps for Large, Continuously Updating Geospatial Datasets
National Flood Data uses DB2Vector to offer a continuously updated web map for national flood maps that are updated daily. This implementation demonstrates a primary use for DB2Vector: large geospatial datasets that require regular updates.
Flood hazard maps for the United States are very large geospatial datasets. Additionally, the US goverment updates the maps for several US counties every day. Here we discuss how National Flood Data uses the Clockwork Micro DB2Vector service to deliver continuously updated vector tiles, a static map endpoint and a web map.
National Flood Data provides many flood risk data sets, including the US FEMA flood hazard maps, primarily to insurance companies. The technical challenge that National Flood Data faces is updating the flood maps for several US counties every day. The easy part of this process is getting the new data from FEMA and updating a county in a PostGIS database, while the trickier part is creating the web map. When National Flood Data first started, they ran updates every second weekend and created static tiles for all of the US. This meant dividing the US into several regions, extracting large datasets to GeoJSON, using Tippecanoe to create MBTiles and then uploading these to Mapbox. Simplifying this tedious progress gave a lot of the motivation for DB2Vector.
Using Clockwork Micro's DB2Vector, National Flood Data can easily created a vector endpoint for the flood layer. They then started running data updates daily, and everything downstreak of the data updated accordingly. They use a simple SQL query to create their vector tiles, but db2vector allows them to write this in a GUI editor rather than embedding it in an
ogr2ogr query. A change to the query in the editor immediately propagates, unlike changing a big pull of data to GeoJSON. Writing this query is the only technical step. Once the DB2Vector tile layer has been created, the style is set in the Simple Styler, and the map is created using Map Stacker, all with no code.
The example above shows a screen shot of a dynamic map of the high risk flood regions near Huntington Beach, CA, in particular near the property in Humboldt Island with the black outline.
There is now no need to precompute tiles. National Flood Data now also offers the vector tile endpoint to users. Their users then style the flood zone polygons as they like within their applications. National Flood Data's users can also request static images, which are rerouted to Clockwork Micro's map endpoint.
Moving to Clockwork Micro's services has saved National Flood Data development time and allowed them to offer a new services—a vector tile endpoint—without any additional development time.