Hi All,
I'm currently trying to put together an SLD style (for WMS use) that will
crop a raster coverage layer to the borders of an administrative unit
(chosen by id).
This question has been asked in various forms a lot of times before: 1
<http://osgeo-org.1560.x6.nabble.com/How-to-mask-a-raster-layer-td3790665.html>
, 2
<http://osgeo-org.1560.x6.nabble.com/Fwd-SLD-WPS-Help-tt5104233.html#none>,
3
<http://gis.stackexchange.com/questions/102656/how-to-crop-coverage-with-wps-chain-in-sld>,
4
<http://gis.stackexchange.com/questions/147070/how-to-crop-raster-layer-and-polygon-layer-in-sld>,
5
<http://gis.stackexchange.com/questions/50474/how-to-use-cropcoverage-render-transformation-in-geoserver-sld-wps>,
but never quite got a full working answer.
I have a raster layer/store, and a postgis multipolygon feature collection
layer/store. I want to crop the raster by one of the multipolygon selected
using a wms parameter.
Here's what I've tried:
- A style applied to the raster layer, with a static WKT shape.
- This works, but doesn't do what i'm looking for (shape not from
postgis)
- The WKT could be provided externally using "env" substitution, but
my shapes are far too complex to do this in a HTTP request.
- SLD 1 <http://pastebin.com/Q4warVBZ>
- A style applied to the raster layer, which uses "gs:Query" to load
the vector data and filter.
- This doesn't work as there doesn't seems to be a way to specify the
name of the layer/store from which to load a feature collection.
- SLD 2 <http://pastebin.com/DsTAMdHK>
- A style applied to the vector layer, with a cql_filter to select
only a single multipolygon, which uses "gs:GetFullCoverage" to load the
raster data
- This almost works, it crashes at run time. Is it treating a
mutipolygon as a polygon maybe?
- org.postgresql.util.PSQLException: ERROR: parse error - invalid
geometry Hint: "POLYGON ((-?" <-- parse error at position 12 within
geometry, at org.geotools.process.function.ProcessFunction.evaluate
- I think there is probably a way to make this approach work,
(gs:GetFullCoverage work with static WKT)
- SLD 3 <http://pastebin.com/FGRLDwu8>
There is clearly demand of this functionality, so it would be good to get a
working example of this into the official documentation (@ User Manual
» Styling » SLD Extensions in GeoServer » Rendering Transformations).
Anyone have any idea how I can get this to work?
Rob
------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users