Hi all
I work for a GIS company, we are starting to use Geoserver more and more and we love it. Thank you to the community for creating it!
We make use of the GeoTools vec:heatmap module, but there is a limitation that the module uses the viewport’s local maximum and minimum when calculating the colour map ramp, meaning that as you pan to another area with higher values, the colour map changes. We would like to implement something like this Leaflet plugin’s useLocalExtrema option, see: https://www.patrick-wied.at/static/heatmapjs/plugin-leaflet-layer.html
To this end, we propose that the module is called twice (two differently named calls?), once with a global bounding box that analyses the entire layer and instead of returning a raster (heatmap) it returns the globalExtrema, so probably a WPS call returning XML, and then discards the raster.
The second (and subsequent) times the module is called as a WMS, with a smaller bounding box, and providing the previously calculated globalExtrema in viewparams, for example. This would then calculate the heatmap, but before the final normalisation step, we would modify the function to normalise to the provided globalExtrema, thus ending with a value, not between 0…1, but slightly more than 0 to slightly less than 1, unless the viewport contained the highest and/or lowest values. Then, continuing, the raster will be coloured, but not to the maximum colour ramp as before. This will allow for panning across the map without the heatmap colour ramp changing, as well as being able to compare two separate areas accurately.
So, I have a few questions before we embark on this change:
-
Is this a reasonable approach, or is there a better idea?
-
The function resides in org.geotools.process.vector.HeatmapSurface and org.geotools.process.vector.HeatmapProcess which are within the geotools-master\modules*unsupported* directory.
a) Why “unsupported” - what does that mean?
b) Is this the correct place to implement it?
c) I understand that I need to make the change and build geotools, then move that war file to geoserver lib to use it?
- Can I easily modify this function so that instead of return gridCov; it returns XML containing globalExtrema? Is it simply a matter of modifying:
@DescribeResult(name = “result”, description = “Output raster”)
public GridCoverage2D execute(
…
return gridCov;
···
- Once implemented, should I then create a PR: http://docs.geotools.org/latest/developer/procedures/pull_requests.html
Thanks for any and all advice.
Peter