I have an OpenLayers 3 map and I am using Geoserver to host that map. So far, I have mostly frontend related tasks for my mapping application. Now, I need to include zonal statistics feature in my application. I was looking online and found that GeoServer/GeoTools RasterZonalStatistics.Java file is what I need to compute my zonal statistics.
However, I don't know where to write my zonal statistics class.
How can I communicate with this Java class from OpenLayers UI?
For example, should I write my zonal statistics class in a separate eclipse project and host that Java file into GeoServer?
I tried to look online and came across GeoServer's OWS services. However, I am not sure if that's what I need to set up a correct backend class for my OpenLayers app.
How can I communicate with this Java class from my OpenLayers UI to calculate zonal statistics for my Tiff and shp file?