[gdal-dev] JPEG2000 / GMLJP2: parameters seem to be ignored (offset location)

Philippe Ghesquiere philippe.ghesquiere at airbus.com
Fri Mar 29 01:45:08 PDT 2024


Hi all,

I have some questions about GMLJP2 parameters concerning location.


*1) Description*Some JP2K images have a pixel origin different than (0 ; 0)
(DIMAP products for example).

In such cases, the GML header looks like like:
<gml:GridEnvelope>
    *<gml:low>7 7</gml:low>  <========== Different than "0 0"*
    <gml:high>1000 1000</gml:high>
</gml:GridEnvelope>

This origin coordinate should be taken into account for pixel location (See
OGC 05-047r3  p93):
<element name="startPoint" type="gml:integerList" minOccurs="0">
    <annotation>
        <documentation>
             Index position of the first grid post, which
             shall lie somwhere in the GridEnvelope. If absent, the
startPoint is equal
             to the value of gridEnvelope::low from the grid definition.
        </documentation>
    </annotation>
</element>

It seems that this offset is not taken into account by GDAL location
function.

*2) How to reproduce*
2.1) Data creation
Reference (no offset) image:
gdal_create -of JP2OpenJPEG -co GMLJP2=YES -outsize 100 100 -bands 3 -burn
0 -burn 255 -burn 0 -a_srs epsg:32632 -a_ullr 500000 500100 500100 500000
Offset_0.jp2

Image with offset:
sed s/"<gml:low>0 0"/"<gml:low>7 7"/g Offset_0.jp2 > Offset_7.jp2

2.2) Location test
echo "0 0" | gdaltransform Offset_0.jp2 Offset_7.jp2
0 0 0

*3) Question:*
Shouldn't we have a 7 pixels offset between the 2 images

Cheers
Philippe
The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.
If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.
Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.
All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240329/78fccef6/attachment.htm>


More information about the gdal-dev mailing list