[Gdal-dev] Arbitrary XML in JPEG2000

Frank Warmerdam fwarmerdam at gmail.com
Tue Aug 16 09:06:28 EDT 2005


On 8/16/05, Norman Barker <nbarker at rsinc.com> wrote:
>  
> Hi, 
>   
> I am doing a quick prototype for creating a series of JPEG2000 image with
> XML metadata encoded inside the image from a series of tif files with the
> metadata (not geo-metadata) in a tab delimited text file.  I know it can be
> done :-), but I was trying to think of the quickest way to do this with
> GDAL. 
>   
> In particular is there an option with within gdal_translate, to encode xml
> such as <test>test_value</test> from the command line, or can I do this with
> the python bindings? 
>   
> I am using FWTools 0.9.9b2 on Windows. 

Norman, 

There is not currently any way to accomplish this within the
JPEG2000 file.  You could write it to the file as metadata (using
Python for instance) but that would just result in it getting dumped
in the .aux.xml file, assuming you enabled the PAM feature of GDAL.

Emitting custom XML inside the JPEG2000 file wouldn't be all that
hard.  Using the ECW SDK, you can see how this is accomplished
in GDALECWCompressor::PrepareCoverageBox() in 
gdal/frmts/ecw/ecwcreatecopy.cpp.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list