On mercredi 8 novembre 2017 14:50:54 CET Ari Jolma wrote:
> Ari Jolma kirjoitti 08.11.2017 klo 13:48:
> >  for MapServer and GeoServer I need to have at least two hack options
> > (NoOffsetSwap and NoGridEnvelopeSwap, maybe there could be only one).
> > I have not yet checked if the rasters returned from those two are ok.
> 
> The rasters that those servers return are ok. I just need the one
> additional hack option for GeoServer to swap the axis names for the
> GetCoverage request.
> 
> I also don't need to use the GridFunction information.

One thing that is confusing, and rings some bells to me as I saw that with 
GMLJP2 (the
GDAL_JP2K_ALT_OFFSETVECTOR_ORDER config option in gdaljp2metadata.cpp) is the 
order of the offetVector element

>From your example, we have:

MapServer:
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/4326";>0 
0.004167</gml:offsetVector>
<gml:offsetVector 
srsName="http://www.opengis.net/def/crs/EPSG/0/4326";>-0.004167 
0</gml:offsetVector>

GeoServer:
<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/2393";>0.0 
20.00803035910304</gml:offsetVector>
<gml:offsetVector 
srsName="http://www.opengis.net/def/crs/EPSG/0/2393";>-20.00803035910304 
0.0</gml:offsetVector>

Rasdaman
<offsetVector srsName="http://ows.rasdaman.org/def/crs/EPSG/0/4326";>-0.02 
0</offsetVector>
<offsetVector srsName="http://ows.rasdaman.org/def/crs/EPSG/0/4326";>0 
0.02</offsetVector> 

So in all 3 cases, the order of the value *inside* a offetVector element is 
lat/northing long/easting as those CRS as lat-long / northing-easting. OK

BUT Rasdaman does an extra swap of the offsetVector elements themselves.

What is not clear (among many things) is when GridFunction applies. If it 
applies before linking the raster/grid space to the georeferenced space,
that is the first offsetVector applies to the fastest varying dimension of the 
final grid,
then I'd say MapServer & GeoServer do the right thing (GeoServer probably 
closer to correctenss, due to te
presence of the GridFunction). Otherwise, if its applied at the very end of the 
process, Rasdaman is probably correct.

Practically I'd say if you have
<offsetVector srsName="...">A B</offsetVector>
<offsetVector srsName="...">C D</offsetVector> 
with SRS with lat-long or northing-easting order, with high confidence 
regarding how "correct" an implementation is:
 * if A != 0 and D > 0 and C=B=0, D the x resolution and A is the y resolution .
 * if A=D=0 and C != 0 and B > 0, then B is the x resolution and C the y 
resolution.
In other situations, good luck...

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to