[gdal-dev] Meaning of origin in JP2GML

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Mon Feb 27 04:12:37 EST 2012


Hi,

Is there one, valid and unambiguous interpretation about what the "origin" means
in JPEG2000 OGC-GML style metadata? 

<gml:origin>
   <gml:Point gml:id="P0001" srsName="urn:ogc:def:crs:EPSG::3067">
   <gml:pos>320000.0000000000000 6953999.5000000000000</gml:pos>
   </gml:Point>
</gml:origin>

I have read from a mail by Frank Warmerdam that origin should mean 
the centre of the anchor pixel. However, it looks like one major 
software vendor has a different interpretation and places the corner
of the corner pixel into the origin.

>From the OGC documents I could only find a Public discussion paper 
https://portal.opengeospatial.org/files/?artifact_id=35653 which, if I
understand it right, is giving the same advice than Frank.

Excerpt:
" g)
The location of the origin of the ImageDatum should be the grid point 
in a corner of the rectangular array of pixel values, at the center 
of a pixel. [Best Practice]
NOTE As stated in Clause B.3.5 of Topic 2, the anchorDefinition pixel 
is usually either the centre or a corner of the image. This document 
recommends that the origin be a corner of the rectangular array. 
Notice that the anchorDefinition is different from the pixelInCell, 
which specifies whether the origin is centered on a pixel or is halfway
between pixel centers. This document recommends that the origin always 
be centered on a corner pixel"

Now I have a few sample images which include either GeoJP2 georeferencing
or JP2GML georeferencing and GDAL finds different extents for those. If 
JPEG2000 image contains both GeoJP2 and JP2GML boxes then GDAL seems 
to select the GeoJP2 one which is good in my case because for these 
images it gives the correct georeferencing.

The JP2GML itself contains only the gml:RectifiedGridCoverage definitions 
for the image but I haven't been able to find yet anything about how the 
raster image pixels should be placed to suit the RectifiedGridCoverage. 
I did find that there there exists a gml:pixelInCell element which can 
be set to mean either cell corner or cell centre but as far as I 
understood JP2GML does not contain this element.

Sometimes I wonder why those OGC publications are called as "standards".

-Jukka Rahkonen-




More information about the gdal-dev mailing list