[geotk] ISO 19115-2 support
Martin Desruisseaux
martin.desruisseaux at geomatys.fr
Tue Dec 8 18:52:26 EST 2009
Hello David, and welcome!
David Neufeld a écrit :
> We are also interested in the ISO 19115-2 support, and would like to
> generate ISO 19115-2 from a NetCDF file.
This is also our plan. I was supposed to start the work on NetCDF this week (I
think next week would be more realist), so the timing looks excellent :).
> In the example below - marshallMetadataInstrument(), we can populate an
> instrument object using setter methods and then marshal it to ISO 19115
> XML which returns:
>
> <gmd:MI_Instrument ...>
> ...
> </gmd:MI_Instrument>
>
> But it's not clear how to generate ISO 19115-2 XML from a populated
> DefaultInstrument object using the SpatialMetadata class (or whether
> this is the wrong approach entirely).
>
> SpatialMetadataFormat stream = SpatialMetadataFormat.STREAM;
> SpatialMetadata spatialMeta = new SpatialMetadata(stream);
> Instrument instrument = spatialMeta.getInstanceForType(Instrument.class);
> defInstrument = new DefaultInstrument(instrument);
> //IllegalArgumentException: No such element: Citations
This is exactly the intended approach. I have not yet tried however to create a
DefaultInstrument (or any object from the org.geotoolkit.metadata.iso package)
from the output of SpatialMetadata.getInstanceForType(...). But the intend is to
make it work the way you did. I will create a JUnit test with the above code so
I can look at the stack trace and make it work.
Thanks for trying Geotk! and best regards,
Martin
More information about the Geotoolkit
mailing list