[GeoNetwork-users] CSW - GetRecords (filter time range and polygon)

Hello GeoNetwork users,

I am looking for the right GetRecords request body for the following searches:

* time range (TempExtent_begin and TempExtend_end see: OGC 07-045 p. 48)
  which is coded in the metadata xml like this:

   <gmd:EX_TemporalExtent>
     <gmd:extent>
        <gml:TimePeriod gml:id="IDcd3b1c4f-b5f7-439a-afc4-3317a4cd89be"
                        xsi:type="gml:TimePeriodType">
          <gml:beginPosition>2010-10-17T11:15:00+01:00</gml:beginPosition>
            <gml:endPosition>010-10-17T11:15:00</gml:endPosition>
        </gml:TimePeriod>
     </gmd:extent>
   </gmd:EX_TemporalExtent>

* a polygon, which is coded in the metadata xml like this:

   <gmd:geographicElement>
         <gmd:EX_BoundingPolygon>
             <gmd:extentTypeCode>
                  <gco:Boolean>true</gco:Boolean>
             </gmd:extentTypeCode>
             <gmd:polygon>
                <gml:Polygon gml:id="Pg1">
                     <gml:exterior>
                        <gml:LinearRing>
                               <gml:coordinates>5.29517,59.623 ...</gml:coordinates>
                        </gml:LinearRing>
                     </gml:exterior>
                </gml:Polygon>
              </gmd:polygon>
          </gmd:EX_BoundingPolygon>
    </gmd:geographicElement>

Can anyone help me?

Greetings,
Kieran

--
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!
Jetzt informieren: http://www.gmx.net/de/go/freephone

Hi Kieran,

For time range query (inclusive range) post a request like this:

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd&quot; maxRecords="1000">
  <csw:Query typeNames="dataset,application,datasetcollection,service">
    <csw:ElementSetName>full</csw:ElementSetName>
    <csw:Constraint version="1.1.0">
      <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot;&gt;
        <ogc:And>
          <ogc:PropertyIsGreaterThanOrEqualTo>
            <ogc:PropertyName>TempExtent_begin</ogc:PropertyName>
            <ogc:Literal>2010-10-01T01:01:01Z</ogc:Literal>
          </ogc:PropertyIsGreaterThanOrEqualTo>
          <ogc:PropertyIsLessThanOrEqualTo>
            <ogc:PropertyName>TempExtent_end</ogc:PropertyName>
            <ogc:Literal>2010-10-31T23:59:59Z</ogc:Literal>
          </ogc:PropertyIsLessThanOrEqualTo>
        </ogc:And>
      </ogc:Filter>
    </csw:Constraint>
  </csw:Query>
</csw:GetRecords>

Note that there is some conversion from date_time in the metadata to date_time
stored in Lucene index against which the query is run as follows:

***Conversion from d_t in XML metadata to d_t in Lucene****

I have confirmed the following conversion behvaiour by Lucene for date/time
entered in ISO8601 format:

-date/time suffixed with 'Z' remain unconverted i.e the time remains in GMT

-date/time with no suffix are assumed to be local times and are converted
to GMT based on time zone of the local computer by lucene. e.g if you entered
2007-06-01T00:00 (in Sydney GMT+10) it would be converted to
2007-05-31T14:00:00.00Z for storage in Lucene's index.

-date/times with a time zone offset e.g +10:00 have the offset added or subtracted
as appropriate for conversion back to GMT. e.g if I entered 2007-12-04T00:00+10:00
in the XML file it is converted to 2007-12-03T14:00:00.000Z in lucene index

****************************************************************

To find records with that polygon you could try posting a bounding box
query like this but not sure if this would pick up the polygons, I know this
works for metdata with GeographicBoundingBox. Try something
like anyway:

<?xml version="1.0" encoding="UTF-8"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot; service="CSW" version="2.0.2" resultType="results" outputSchema="http://www.isotc211.org/2005/gmd&quot; maxRecords="1000">
  <csw:Query typeNames="dataset,application,datasetcollection,service">
    <csw:ElementSetName>full</csw:ElementSetName>
    <csw:Constraint version="1.1.0">
      <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:gml="http://www.opengis.net/gml&quot;&gt;
        <ogc:Within>
          <ogc:PropertyName>ows:BoundingBox</ogc:PropertyName>
          <gml:Envelope>
            <gml:lowerCorner>141.0 -39.0</gml:lowerCorner>
            <gml:upperCorner>150.0 -34.0</gml:upperCorner>
          </gml:Envelope>
        </ogc:Within>
      </ogc:Filter>
    </csw:Constraint>
  </csw:Query>
</csw:GetRecords>

HTH
Andrew

----- Original Message ----- From: <kieransun@anonymised.com>
To: <geonetwork-users@lists.sourceforge.net>
Sent: Thursday, January 12, 2012 9:03 PM
Subject: [GeoNetwork-users] CSW - GetRecords (filter time range and polygon)

Hello GeoNetwork users,
I am looking for the right GetRecords request body for the following searches:
* time range (TempExtent_begin and TempExtend_end see: OGC 07-045 p. 48) which is coded in the metadata xml like this:
  <gmd:EX_TemporalExtent> <gmd:extent> <gml:TimePeriod gml:id="IDcd3b1c4f-b5f7-439a-afc4-3317a4cd89be" xsi:type="gml:TimePeriodType"> <gml:beginPosition>2010-10-17T11:15:00+01:00</gml:beginPosition> <gml:endPosition>010-10-17T11:15:00</gml:endPosition> </gml:TimePeriod> </gmd:extent> </gmd:EX_TemporalExtent>
* a polygon, which is coded in the metadata xml like this:
  <gmd:geographicElement> <gmd:EX_BoundingPolygon> <gmd:extentTypeCode> <gco:Boolean>true</gco:Boolean> </gmd:extentTypeCode> <gmd:polygon> <gml:Polygon gml:id="Pg1"> <gml:exterior> <gml:LinearRing> <gml:coordinates>5.29517,59.623 ...</gml:coordinates> </gml:LinearRing> </gml:exterior> </gml:Polygon> </gmd:polygon> </gmd:EX_BoundingPolygon> </gmd:geographicElement>
Can anyone help me?
Greetings, Kieran
-- NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie! Jetzt informieren: http://www.gmx.net/de/go/freephone
------------------------------------------------------------------------------RSA(R) Conference 2012Mar 27 - Feb 2Save $400 by Jan. 27Register now!http://p.sf.net/sfu/rsa-sfdev2dev2_______________________________________________GeoNetwork-users mailing listGeoNetwork-users@anonymised.com://lists.sourceforge.net/lists/listinfo/geonetwork-usersGeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork