Isobands are the regions where the raster values are in an interval. It’s useful to simplify the visualized data, since the method shown at the drawing raster data section can create confusing images.
Calculating these isobands can be a bit difficult, that’s why I adapted the MarchingSquares.js library to use with a geoPath: raster-marching-squares
The important code parts are these. You can find the whole code here.
- The projection is set to geoAzimuthalEqualArea, but the nice thing about D3js is that this could be changed and the result would change accordingly
- Note that, as explained in the reading a raster page, the request is a bit different for the GeoTIFF
Using an SVG can be useful if we want the user to know the band value by selecting it, for instance.
The code is similar to the one at the Canvas version. You can find the whole code here.
The most important part is: