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?

  • You need a wps process
    – Ian Turton
    Commented Aug 13, 2017 at 0:26

1 Answer 1


You need to use the WPS protocol to ask GeoServer to run processes for you. If all you need are the ZonalStatistics then this tutorial will show you how.

If you want to develop your own processes then you need to follow this section of the manual.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.