[Geoserver-devel] Issues with WCS and rotated grids

Hi,
implementing and testing the WCS 1.1 DescribeCoverage I noticed
a problem with metadata handling in relation to the grid to world
transformation.

Basically the current code assumes the grid is not rotated or
skewed, this is visible in a few places:
* the info.xml format only contains the raster and geographi
   envelopes
* the xml reader creates a fake gridToWorld transformation
   by comparing the two above envelopes
* the DescribeResponse code will always generate OffsetVector
   elements that look like:
<gml:offsetVector>scaley 0.0</gml:offsetVector>
<gml:offsetVector>0.0 scaley</gml:offsetVector>
   because the 0.0 elements are hard coded as strings.

All of this breaks down badly when a coverage whose world
to grid transformation is not a pure scale (that is, it has
rotation or skew).

To solve this the actual transformation parameters should
be stored in info.xml. Also, to avoid breaking backwards
compatibility, the old method of computing the gridToWorld
transformation should be used when info.xml does not contain
the transform information.

At the moment in my DescribeCoverage code I'm opening
to coverage to actually read those params, but for some
kind of coverages that may be very expensive...

Alessio, Simone, what do you think?
Cheers
Andrea

Andrea Aime a écrit :

* the DescribeResponse code will always generate OffsetVector
   elements that look like:
<gml:offsetVector>scaley 0.0</gml:offsetVector>
<gml:offsetVector>0.0 scaley</gml:offsetVector>
   because the 0.0 elements are hard coded as strings.

I pointed this problem in a previous email a few months ago. "offsetVector" is
just an other way to specify affine transform coefficients. The values should be:

<gml:offsetVector>scalex shearx</gml:offsetVector>
<gml:offsetVector>sheary scaley</gml:offsetVector>

Generally speaking, we still have a fair amount of GeoTools and GeoServer code
that still need to be fixed for affine transform handling. As a rule of thumb,
if you see a "if" statement applied on an AffineTransform value, there is high
chances that the code is not correct.

See "Use AffineTransform mathematic" at
http://docs.codehaus.org/display/GEOT/5.1.5+Avoid+assumptions

  Martin

Hi Andrea,
I volunteer to create a patch for GeoServer which basically will:

  • store into the info.xml file the optional transform parameters also
  • when reading, look for a transform also and in that case apply the approriate code

The DescribeCoverage 1.0.0 will be also revisited

On Dec 4, 2007 3:33 PM, Martin Desruisseaux <martin.desruisseaux@anonymised.com > wrote:

Andrea Aime a écrit :

  • the DescribeResponse code will always generate OffsetVector
    elements that look like:
    gml:offsetVectorscaley 0.0</gml:offsetVector>
    gml:offsetVector0.0 scaley</gml:offsetVector>
    because the 0.0 elements are hard coded as strings.

I pointed this problem in a previous email a few months ago. “offsetVector” is
just an other way to specify affine transform coefficients. The values should be:

gml:offsetVectorscalex shearx</gml:offsetVector>
gml:offsetVectorsheary scaley</gml:offsetVector>

Generally speaking, we still have a fair amount of GeoTools and GeoServer code
that still need to be fixed for affine transform handling. As a rule of thumb,
if you see a “if” statement applied on an AffineTransform value, there is high
chances that the code is not correct.

See “Use AffineTransform mathematic” at
http://docs.codehaus.org/display/GEOT/5.1.5+Avoid+assumptions

Martin

Eng. Alessio Fabiani
Vice-President /CTO GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax: +39 0584983027
mob: +39 349 8227000

http://www.geo-solutions.it