[gdal-dev] GDAL setMetadata(HashTable) / setMetadata(String) on java.

Daniele Romagnoli dany.geotools at gmail.com
Fri Jan 18 04:48:53 EST 2008


Hi list,
I have some problems to set metadata in a dataset (as an instance, a
GeoTiff) using Java bindings.
I'm attempting to add some metadata in the default domain (""). I also have
enabled the PAM mechanism which should allow to add auxiliary metadata.

Now, when I attempt to set several metadata using the following code,
dataset.setMetadata("IMAGE__INPUT_NAME=temp","");
dataset.setMetadata("IMAGE__WIDTH=3000","");
dataset.setMetadata("IMAGE__HEIGHT=3000","");

only the last one (IMAGE__HEIGHT=3000) is displayed when calling gdalinfo on
the just created output dataset.
Is the setMetadata method "overriding"? I mean: does any setMetadata call
override the last set value?
Finally, I also have attempted to directly use an HashTable as input
parameter of setMetadata and the JVM crashes.
(I also have tuned the HashTable to be sure it does not contains null
keys/entries).

Is there someone which has already set metadata via Java Bindings? Maybe I'm
using a wrong approach.
Thanks for any help.

Best Regards,
Daniele Romagnoli


-- 
-------------------------------------------------------
Eng. Daniele Romagnoli
Software Engineer

GeoSolutions S.A.S.
Via Carignoni 51
55041 Camaiore (LU)
Italy

phone: +39 0584983027
fax:     +39 0584983027
mob:   +39 328 0559267


http://www.geo-solutions.it

-------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20080118/7e4ca3cc/attachment.html


More information about the gdal-dev mailing list