I have layers based on GeoTIFF files, provided by GeoServer, that are displayed as overlays over base maps from OpenStreetMaps, Bing, Google via OpenLayers. I want to mask out areas from the GeoTIFF overlays but enable the base maps to continue to their full extent / appear around the boundaries of my mask.
How to crop coverage with WPS chain in sld? had the clues for creating a SLD that includes a WPS transformation that crops a layer to a shape definition. That works fine for the layer by itself, i.e., in GeoServer's own OpenLayers layer preview. But if I display that layer on top of a base map in my application, performance of the base map layer display plummets (up to minutes to display vs nearly instantaneous), CPU usage on my laptop spikes, and I end up with pink tiles where some of the base map should be. I suspect the performance hit occurs because of the (relatively simple, 10 point but continent sized, polygon used by the cropShape definition.
This GeoTools CropCoverage source code suggests that I could use a coverage definition provided by an input raster.
My questions: Can that raster be defined as part of GeoServer WPS SLD transformation? How do I define that input raster? Is there an example somewhere? Ultimately, will that improve base map display performance or is my suspicion wrong and there is some other reason for display being so slow when there is a base map in addition to the overlay with this SLD change is made for the overlay?