Map algebra for raster is easy with ArcGIS Raster Calculator (or QGIS). I had thought this would be easy with web GIS servers such as GeoServer and MapServer plus OpenLayers etc. as well. What I want to achieve is to do simple things like dividing two images and generate a third, ratio image to be displayed in the webpage. I spent weeks to find a solution and it turns out to the pretty hard (for me).
I have tried a few things including:
PostGIS raster. I think raster algebra isn't a problem here.
But PostGIS raster is pretty difficult to load into GeoServer. There are many many questions repeatedly asked about how to load pgraster in GeoServer. See e.g. How to import GeoTIFF via postGIS into GeoServer?? , https://gis.stackexchange.com/questions/86006/publish-rasters-stored-in-postgresql-with-geoserver?, among others. Not a single answer here in GIS.SE or the GeoServer official website gives a complete list of steps that can be followed to work. Loading pgraster into MapServer has reported success, but with very slow performance. Both seem to require some tiling, and a one-liner command to import a raster to either server seems to be out of the question.
GeoTIFF is easy to load into GeoServer and MapServer. But what can we do with it? Without a PostGIS like SQL, I turned to and briefly searched using WCS to do map algebra, but didn't find much. Is WCS a viable path for this with current servers?
Program it the hard way
Somehow use AJAX to call a PHP page or write a WPS using GeoServer for importing images into PostGIS, doing the map algebra and then converting the result pgraster to a format (e.g. GeoTIFF) that can be easily loaded and displayed in GeoServer/MapServer.
Of course, one can write code to read GeoTIFF's directly and do the map algebra without GIS support.
None of the above seems to be easy or reasonable to me considering the ease with which the same algebra can be done in Desktop GIS.
I was wondering if someone has had any experience doing Map Algebra in a web GIS environment, and can suggest a viable path?
I am interested in Open Source solutions (for political reasons inside my organization.) I am aware that ArcGIS Server can call python code of ArcGIS, but we don't have the license and the environment here is not favorable for acquiring one.