You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sis.apache.org by Martin Desruisseaux <ma...@geomatys.com> on 2016/06/27 08:40:11 UTC

Landsat to ISO 19115 metadata mapping

Hello all

As part of Hao's work on Google Summer of Code, we have a partial
mapping from Landsat to ISO 19115 metadata. The mapping is temporarily
documented here (will be moved to Apache SIS javadoc later):

http://htmlpreview.github.io/?https://raw.githubusercontent.com/desruisseaux/sis/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/doc-files/LandsatMetadata.html

We will complete this mapping progressively. Does anyone has comment?

Note for Hao: we have a slight mismatch between the Landsat and ISO
19115 geographic bounding box. For example the Landsat
CORNER_UL_LAT_PRODUCT is:

    The latitude value for the upper-left corner of the product,
    _*measured at the center of the pixel*_. Positive (+) value
    indicates north latitude; negative (-) value indicates south
    latitude. Units are in degrees.

While ISO 19115 northBoundLatitude is:

    Northern-most coordinate of the _*limit of the resource extent*_
    expressed in latitude in decimal degrees (positive north).

Between the two, there is a difference of 0.5 pixels. It may look small,
but a pixel of a remote sensing image may cover an area of some
kilometres on Earth.

    Martin



Re: Landsat to ISO 19115 metadata mapping

Posted by phuong hao nguyen thi <ng...@gmail.com>.
Hello Martin,
Yes, I will note this part in my work .
Thanks so much
Hao

On Thu, Jun 30, 2016 at 6:36 AM, Martin Desruisseaux <
martin.desruisseaux@geomatys.com> wrote:

> Hello Hao
>
> Good that the bounding box is back.
>
> I created a pull request for a new package,
> "org.apache.sis.services.csw", in the sis-webapp module. It contains a
> "Catalog" class which is only beginning. This "Catalog" is a partial
> port of the "Record" class that you wrote in the VNSCweb repository. I
> added Apache header (this is mandatory) and some documentation. The most
> significant change is that "Catalog" stores Metadata objects instead
> than summary objects.
>
> I do not suggest to replace "Record" by "Catalog" now. This is just a
> first draft for identifying which adaptations will be needed for SIS.
> You can ignore and continue on VNSCweb for now. However it would be nice
> if you could put more documentation. For example I noticed a "distance"
> method in the "Calculate" class, but the documentation does not said
> which kind of distance is computed (it is not the Euclidean distance).
>
> Note that there is some methods in SIS for computing distance, but in
> order to know if they are suitable, we need to know which kind of
> distance is computed by "distance". For example is it an "orthodromic"
> distance (i.e. the shortest distance between two points on Earth by
> following a great circle?)
>
>     Martin
>
>
> Le 29/06/16 à 13:02, phuong hao nguyen thi a écrit :
> > I created a new class in web service to print xml file and printed
> > boundingbox :)
>
>

Re: Landsat to ISO 19115 metadata mapping

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Hao

Good that the bounding box is back.

I created a pull request for a new package,
"org.apache.sis.services.csw", in the sis-webapp module. It contains a
"Catalog" class which is only beginning. This "Catalog" is a partial
port of the "Record" class that you wrote in the VNSCweb repository. I
added Apache header (this is mandatory) and some documentation. The most
significant change is that "Catalog" stores Metadata objects instead
than summary objects.

I do not suggest to replace "Record" by "Catalog" now. This is just a
first draft for identifying which adaptations will be needed for SIS.
You can ignore and continue on VNSCweb for now. However it would be nice
if you could put more documentation. For example I noticed a "distance"
method in the "Calculate" class, but the documentation does not said
which kind of distance is computed (it is not the Euclidean distance).

Note that there is some methods in SIS for computing distance, but in
order to know if they are suitable, we need to know which kind of
distance is computed by "distance". For example is it an "orthodromic"
distance (i.e. the shortest distance between two points on Earth by
following a great circle?)

    Martin


Le 29/06/16 � 13:02, phuong hao nguyen thi a �crit :
> I created a new class in web service to print xml file and printed
> boundingbox :)


Re: Landsat to ISO 19115 metadata mapping

Posted by phuong hao nguyen thi <ng...@gmail.com>.
Hello Martin,
I created a new class in web service to print xml file and printed
boundingbox :)
Thanks so much , this is land.xml file

On Wed, Jun 29, 2016 at 5:09 PM, phuong hao nguyen thi <
nguyenthiphuonghao243@gmail.com> wrote:

> Hello Martin
> I read it in LandsatReader  ( ApacheSIS)
>
> On Wed, Jun 29, 2016 at 3:11 PM, Martin Desruisseaux <
> martin.desruisseaux@geomatys.com> wrote:
>
>> Hello Hao
>>
>> Le 29/06/16 à 01:32, phuong hao nguyen thi a écrit :
>> > When I  System.out.println(metadata) I see the bounding box but when I
>> use
>> > XML.marshall()  I don't see it
>>
>> I did not find a call to XML.marshall in the source code of
>> fiser-chinhvm/VNSCweb. Could you point me to the place in the code where
>> the metadata is read of created?
>>
>>     Martin
>>
>>
>>
>

Re: Landsat to ISO 19115 metadata mapping

Posted by phuong hao nguyen thi <ng...@gmail.com>.
Hello Martin
I read it in LandsatReader  ( ApacheSIS)

On Wed, Jun 29, 2016 at 3:11 PM, Martin Desruisseaux <
martin.desruisseaux@geomatys.com> wrote:

> Hello Hao
>
> Le 29/06/16 à 01:32, phuong hao nguyen thi a écrit :
> > When I  System.out.println(metadata) I see the bounding box but when I
> use
> > XML.marshall()  I don't see it
>
> I did not find a call to XML.marshall in the source code of
> fiser-chinhvm/VNSCweb. Could you point me to the place in the code where
> the metadata is read of created?
>
>     Martin
>
>
>

Re: Landsat to ISO 19115 metadata mapping

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Hao

Le 29/06/16 � 01:32, phuong hao nguyen thi a �crit :
> When I  System.out.println(metadata) I see the bounding box but when I use
> XML.marshall()  I don't see it

I did not find a call to XML.marshall in the source code of
fiser-chinhvm/VNSCweb. Could you point me to the place in the code where
the metadata is read of created?

    Martin



Re: Landsat to ISO 19115 metadata mapping

Posted by phuong hao nguyen thi <ng...@gmail.com>.
Hello Martin,
Thank so much,
When I  System.out.println(metadata) I see the bounding box but when I use
XML.marshall()  I don't see it
Hao

On Wed, Jun 29, 2016 at 6:17 AM, Martin Desruisseaux <
martin.desruisseaux@geomatys.com> wrote:

> Hello Hao
>
> I saw on the GitHub repository that the work is progressing well. Keep
> going!
>
>
> Le 28/06/16 à 02:34, phuong hao nguyen thi a écrit :
> > This is Xpart for MOD021KM Metadata :
> >
> /_MI_Metadata_/identificationInfo/_MD_DataIdentification_/citation/CI_Citation/identifier/MD_Identifier/code/CharacterString
> > This is Xpart for lansat metadata :
> >
> /_MD_Metadata_/identificationInfo/_MD_Identification_/citation/CI_Citation/identifier/MD_Identifier/code/CharacterString.
>
> The first XPath begins with "MI_" and the second XPath begins with
> "MD_". The second one (MD_Metadata) is defined by ISO 19115. The first
> one (MI_Metadata) is defined in an extension called ISO 19115-2. This
> may look a little bit complicated, but the reason for that separation is
> not really technical. It is rather (in my understanding) historical.
>
> Actually, if I look at the ParseXML class, I see that you need to care
> about MD_Metadata or MI_Metadata name because you parse the XML file as
> a org.w3c.dom.Document, then use XPath for extracting value. It is okay
> to do that way if you wish. But alternatively, you could also let Apache
> SIS do the parsing for you. Apache SIS should be "intelligent" enough
> for supporting MD_Metadata and MI_Metadata almost like synonymous. It
> may be easier for you since you would need need to worry anymore about
> the different XPaths.
>
>     Metadata md = (Metadata) XML.umarshal(new
> File("/home/haonguyen/data/LC81230522014071LGN00_MTL.xml"));
>     Identification id = first(md.getIdentificationInfos());
>     Identifier identifier = first(id.getCitation().getIdentifier());
>
> With the following convenience method:
>
>     private static <E> E first(Collection<E> c) {
>         Iterator<E> it = c.iterator();
>         if (it.hasNext()) {
>             return it.next();
>         } else {
>             return null;
>         }
>     }
>
> With this approach, you would not need to worry anymore about
> MI_Metadata versus MD_Metadata.
>
>
> > And this is xml full when I XML.marshal(metadata.new File (...)) for
> > landsat metadata
> > don't have the value boudingbox.
>
> Do you see the bounding box in System.out.println(metadata)?
>
>     Martin
>
>
>

Re: Landsat to ISO 19115 metadata mapping

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Hello Hao

I saw on the GitHub repository that the work is progressing well. Keep
going!


Le 28/06/16 � 02:34, phuong hao nguyen thi a �crit :
> This is Xpart for MOD021KM Metadata :
> /_MI_Metadata_/identificationInfo/_MD_DataIdentification_/citation/CI_Citation/identifier/MD_Identifier/code/CharacterString
> This is Xpart for lansat metadata :
> /_MD_Metadata_/identificationInfo/_MD_Identification_/citation/CI_Citation/identifier/MD_Identifier/code/CharacterString.

The first XPath begins with "MI_" and the second XPath begins with
"MD_". The second one (MD_Metadata) is defined by ISO 19115. The first
one (MI_Metadata) is defined in an extension called ISO 19115-2. This
may look a little bit complicated, but the reason for that separation is
not really technical. It is rather (in my understanding) historical.

Actually, if I look at the ParseXML class, I see that you need to care
about MD_Metadata or MI_Metadata name because you parse the XML file as
a org.w3c.dom.Document, then use XPath for extracting value. It is okay
to do that way if you wish. But alternatively, you could also let Apache
SIS do the parsing for you. Apache SIS should be "intelligent" enough
for supporting MD_Metadata and MI_Metadata almost like synonymous. It
may be easier for you since you would need need to worry anymore about
the different XPaths.

    Metadata md = (Metadata) XML.umarshal(new File("/home/haonguyen/data/LC81230522014071LGN00_MTL.xml"));
    Identification id = first(md.getIdentificationInfos());
    Identifier identifier = first(id.getCitation().getIdentifier());

With the following convenience method:

    private static <E> E first(Collection<E> c) {
        Iterator<E> it = c.iterator();
        if (it.hasNext()) {
            return it.next();
        } else {
            return null;
        }
    }

With this approach, you would not need to worry anymore about
MI_Metadata versus MD_Metadata.


> And this is xml full when I XML.marshal(metadata.new File (...)) for
> landsat metadata
> don't have the value boudingbox.

Do you see the bounding box in System.out.println(metadata)?

    Martin



Re: Landsat to ISO 19115 metadata mapping

Posted by phuong hao nguyen thi <ng...@gmail.com>.
Hello Martin,

This is Xpart for MOD021KM Metadata : /*MI_Metadata*/identificationInfo/
*MD_DataIdentification*
/citation/CI_Citation/identifier/MD_Identifier/code/CharacterString
This is Xpart for lansat metadata : /*MD_Metadata*/identificationInfo/
*MD_Identification*/citation/CI_Citation/identifier/MD_Identifier/code/CharacterString
. ReadXML.java is a class to read metadata

And this is xml full when I XML.marshal(metadata.new File (...)) for
landsat metadata
don't have the value boudingbox .
Thanks
Hao


On Mon, Jun 27, 2016 at 6:17 PM, phuong hao nguyen thi <
nguyenthiphuonghao243@gmail.com> wrote:

> Hello Martin ,
> Yes, I'm understand , I will complete the part mapping bouding box . And
> In  part , webservice csw , Are you have the opinion?
> Thanks so much .
> Hao
> Vào 27-06-2016 15:42, "Martin Desruisseaux" <
> martin.desruisseaux@geomatys.com> đã viết:
>
>> Sorry, the temporary link for the Landsat to ISO 19115 metadata is:
>>
>>
>> http://htmlpreview.github.io/?https://raw.githubusercontent.com/haonguyen123/sis/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/doc-files/LandsatMetadata.html
>>
>>     Martin
>>
>>

Re: Landsat to ISO 19115 metadata mapping

Posted by phuong hao nguyen thi <ng...@gmail.com>.
Hello Martin ,
Yes, I'm understand , I will complete the part mapping bouding box . And
In  part , webservice csw , Are you have the opinion?
Thanks so much .
Hao
Vào 27-06-2016 15:42, "Martin Desruisseaux" <
martin.desruisseaux@geomatys.com> đã viết:

> Sorry, the temporary link for the Landsat to ISO 19115 metadata is:
>
>
> http://htmlpreview.github.io/?https://raw.githubusercontent.com/haonguyen123/sis/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/doc-files/LandsatMetadata.html
>
>     Martin
>
>

Re: Landsat to ISO 19115 metadata mapping

Posted by Martin Desruisseaux <ma...@geomatys.com>.
Sorry, the temporary link for the Landsat to ISO 19115 metadata is:

http://htmlpreview.github.io/?https://raw.githubusercontent.com/haonguyen123/sis/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/doc-files/LandsatMetadata.html

    Martin