I'm working on an application where I want to present bathymetric visualizations of different bodies of water on top of a slippy map. In essence these are geographically contained topographic visualisations based on interpolated DEM data. The result I'm after is something in the line of:
I have written code to interpolate the DEMs from depth samples and have a proof of concept in place where I store these in non-tiled rasters in PostGIS (one raster per body of water) which works fairly well.
I do believe however that I will have to replace this concept with some kind of tile based solution since bodies of water can be of almost arbitrary size and the visual aspects should probably be adjusted based on zoom-level etc.
If this was all there was to it, I would probably just mimic regular elevation raster generation concepts described in various places, often based on Mapnik. However, here is where the fun starts..
Ideally I do not want to present raster data, but rather vectors (or perhaps a combination of the two). I want my map to be more interactive than is generally possible with raster data (unless the raster data is teared apart and analyzed using for example D3 - more on this later). I want to have the possibility to change equidistance (distance and value of contour lines) dynamically based on user interaction.
I would love to have some clever input as how to arrange this stack. Some ideas I want to ventilate:
1. Raster tiles only Elevation DEM rasters are generated based on classical 256x256 mercator concepts. These are downloaded dynamically by the client browser and either displayed as-is, or colour mapped using canvas/D3. On top of this I use the canvas API to extract vector contours using D3. This would be a fairly clean solution but I suspect that it will be to slow (the image inspection part).
2. Raster tiles in combination with vector tiles Elevation DEM rasters are still generated as they constitute a good way to represent and store the interpolated data. The raster tiles may still constitute a graphical overlay on the map, but in essence the elevation contours consist of vector tiles fetched seperately (based on GeoJSON or TopoJSON). These tiles are generated based off the raster riles.
Since I want to be able to change the equidistance on the fly I must be able to unify and combine vectors, for example using D3. I had a look a the d3.geom.contour plugin but it seems a bit limited, for example it seems like there can be no local peaks, but rather a pyramid like topology.
Last, but not least, I want to perform light client side line interpolation (or something similar) for aesthetics. I.e. the resolution of the bathymetric map may be lower (since higher resolution really has no value) but at this resolution contours typically become clunky. Perhaps this is an argument for TopoJSON and it's possibilities with simplification? Here's an example I've made with D3 (using server side generated non-tiles GeoJSON):
Any suggestions are welcome!