[Geoserver-users] georectification via SLD not display in the correct position

Hello list,

We have some data that are non-georectified and we would like to visualize
them over an OSM map (after georectification) in OpenLayers. Since we may
have a quite big quantity of data in our PostGIS database, we would like to
import the different layers in Geoserver without preprocessing them (to
avoid a duplication of data and minimize the db size) and do it on-the-fly
when we display them. To that end, I thought of doing it via styling with
Geoserver.

I am displaying the layer over the OSM map via Openlayers like:

var wms = new OpenLayers.Layer.WMS("Geotiff6",
"http://foo.bar/geoserver/opengeo/wms",
                                        {
                                                layers: "test",
                                                styles: "georectify2",
                                                env:
"wms_transparent:false;wms_crs:EPSG:900913;wms_gcp:[[[0, 0],
[724181.691693196, 5863101.45682414]], [[0, 450], [724330.553821501,
5858374.51975302]], [[600, 0], [735455.441977693, 5863497.42149311]], [[600,
450], [734605.806108252, 5858693.98805558]]]",

                                        },
                                        {
                                                singleTile: true,
                                                isBaseLayer: false,
                                        }
                                );

with the style being :

<?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&quot; xmlns:ogc="http://www.opengis.net/ogc&quot;
xmlns:xlink="http://www.w3.org/1999/xlink&quot;
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
    <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:Function
name="env"><ogc:Literal>wms_gcp</ogc:Literal></ogc:Function>
              </ogc:Function>
              <ogc:Function name="parameter">
                <ogc:Literal>targetCRS</ogc:Literal>
                <ogc:Function
name="env"><ogc:Literal>wms_crs</ogc:Literal></ogc:Function>
              </ogc:Function>
              <ogc:Function name="parameter">
                <ogc:Literal>transparent</ogc:Literal>
              <ogc:Function
name="env"><ogc:Literal>wms_transparent</ogc:Literal></ogc:Function>
              </ogc:Function>
            </ogc:Function>
          </Transformation>
         
          <Rule>
           <RasterSymbolizer>
             <Opacity>1.0</Opacity>
           </RasterSymbolizer>
         </Rule>

        </FeatureTypeStyle>
      </UserStyle>
    </NamedLayer>
</StyledLayerDescriptor>

ie I pass the coordinates, the CRS and the transparent parameter through a
GET request with the "env" variable. Neither Geoserver nor OpenLayers return
me an error or warning, and the layer seems to be correctly orthorectified,
but it doesn't appear at the correct coordinates. If you look at the picture
below, you can see that it appears north of the position defined (the
polygon).

I tried everything I could thing of with OL without any luck, and the
problem seems to lie with Geoserver. Is this a bug of the WPS process, or is
the style incorrect?

Also, I don't know if the idea of doing the on-the-fly georectification via
styling is the best solution, but the only one we thought could work. Any
help with that would also be very appreciated

Thanks in advance,

Bulkilol

PS: I think the first time I tried to sent the mail failed. I apologies if
there was a double post.

<http://osgeo-org.1560.x6.nabble.com/file/n5074248/georectification2.png&gt;

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/georectification-via-SLD-not-display-in-the-correct-position-tp5074248.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

On Mon, Aug 26, 2013 at 10:09 AM, bulkilol <bulkilol@anonymised.com> wrote:

I tried everything I could thing of with OL without any luck, and the
problem seems to lie with Geoserver. Is this a bug of the WPS process, or
is
the style incorrect?

The process in the end just calls onto gdalwarp, so you might want to try
calling it directly with one of your images and see if that works as
expected.

I'm not 100% sure, but I'm not sure if the image can be orthorectified
correctly,
as it's an oblique one: I see the sky in the top part of the image, that
part should
simply stop to exist in the final image....

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------