Situation
I have a raster image and the coordinates of its four corner pixels. My goal is to warp the image with respect to this coordinates ("georectify") on the fly when requested via GeoServer to display in OpenLayers.
Inspired by this discussion list, my idea was to do the following in GeoServer:
- Create a WorldImage layer (raster + text file with geodata)
- Create a Styled Layer Descriptor (SLD) calling the Web Processing Service (WPS)
GeorectifyCoverage
which "georectifies a raster via Ground Control Points using gdal_warp". - Apply the SLD to the layer.
Problem
When I request the layer for example via the OpenLayers preview, it throws an error reporting:
Could not convert the value EPSG:32632 into the expected type interface
org.opengis.referencing.crs.CoordinateReferenceSystem for parameter targetCRS
Oddly enough, when I use the "WPS request builder" (in the GeoServer Web Application) to call GeorectifyCoverage
with the same parameters, it gives the right output.
So the error must originate somewhere from my SLD document below.
Can anybody give me a clue what might be wrong with it?
Additional Info
SLD document calling WPS rendering transformation GeorectifyCoverage
:
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>GeorectifyCoverage</Name>
<UserStyle>
<Title>Georectify Coverage</Title>
<Abstract>Warps image to specified GCP</Abstract>
<FeatureTypeStyle>
<Transformation>
<ogc:Function name="gs:GeorectifyCoverage">
<ogc:Function name="parameter">
<ogc:Literal>data</ogc:Literal>
</ogc:Function>
<ogc:Function name="parameter">
<ogc:Literal>gcp</ogc:Literal>
<ogc:Literal>[[[0, 0], [308639.500, 5154180.500]], [[0, 450], [308639.500, 5150929.500]], [[600, 0], [315730.500, 5154180.500]], [[600, 450], [315730.500, 5150929.500]]]</ogc:Literal>
</ogc:Function>
<ogc:Function name="parameter">
<ogc:Literal>targetCRS</ogc:Literal>
<ogc:Literal>EPSG:32632</ogc:Literal>
</ogc:Function>
</ogc:Function>
</Transformation>
<Rule>
<RasterSymbolizer>
<Opacity>1.0</Opacity>
</RasterSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
where GeorectifyCoverage
requires the following input:
data
: input raster (my layer name)gcp
: List of Ground control points (my corner coordinates)targetCRS
: system to use for the output raster (my CRS corresponding to the GCP)
Notes:
- When I call a different WPS function like
Contour
using the same document structure and raster image it works perfectly. - When I change
EPSG:32632
toEPSG:4326
the same error is reported. - Changing the raster format (jpeg, TIFF) does not helo.
- Processing the same data offline with the command line tools
gdal_translate
(assign GCPs) andgdalwarp
results in the desired output.
My System:
- Ubuntu 12.04
- OpenGeo Suite 3.0.2
- GeoServer 2.2
Alternative approaches using OpenGeo would also be welcome.