[Geoserver-users] ogc Filter on dateTime field.

Hi all,

make request on dateTime :

it seems that it is not possible to make Filter on dateTime field with Between tag.

  <wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
   <ogc:Between>
      <ogc:PropertyName>issue_time</ogc:PropertyName>
      <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
      </ogc:LowerBoundary>
      <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
      </ogc:UpperBoundary>
   </ogc:Between>
</ogc:Filter>
</wfs:Query>

It works with this kind of filter T0 < t < T1 :

<wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
      <ogc:And>
        <ogc:PropertyIsGreaterThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T12:00:13</ogc:Literal>
        </ogc:PropertyIsGreaterThan>
        <ogc:PropertyIsLessThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T13:00:13</ogc:Literal>
        </ogc:PropertyIsLessThan>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>

Any reasons ?

Sébastien Geindre ha scritto:

Hi all,

make request on dateTime :

it seems that it is not possible to make Filter on dateTime field with Between tag.

  <wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
   <ogc:Between>
      <ogc:PropertyName>issue_time</ogc:PropertyName>
      <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
      </ogc:LowerBoundary>
      <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
      </ogc:UpperBoundary>
   </ogc:Between>
</ogc:Filter>
</wfs:Query>

It works with this kind of filter T0 < t < T1 :

<wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
      <ogc:And>
        <ogc:PropertyIsGreaterThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T12:00:13</ogc:Literal>
        </ogc:PropertyIsGreaterThan>
        <ogc:PropertyIsLessThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T13:00:13</ogc:Literal>
        </ogc:PropertyIsLessThan>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>

Any reasons ?

Well, basically GeoServer was totally unable of correctly handling
any date/time information until some months ago,
so I'm not surprised there are still glitches here and there.

Please open an issue, we'll see what we can do (thougth I fear
the change needed will be quite extensive, since we'll have
to update all sql encoders as well, so for the moment try to
live with the workaround).

Cheers
Andrea

In fact it works well if the filter is like that , example 9 page 22 in OGC Filter specification :

    <ogc:Filter>
      <ogc:PropertyIsBetween>
        <ogc:PropertyName>issue_time</ogc:PropertyName>
        <ogc:LowerBoundary>
          <ogc:Literal>2006-12-14T12:08:13</ogc:Literal>
        </ogc:LowerBoundary>
        <ogc:UpperBoundary>
          <ogc:Literal>2006-12-14T12:38:13</ogc:Literal>
        </ogc:UpperBoundary>
      </ogc:PropertyIsBetween>
    </ogc:Filter>

not like that , example 10 page 22 in OGC Filter specification

    <ogc:Filter>
      <ogc:Between>
        <ogc:PropertyName>issue_time</ogc:PropertyName>
        <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
        </ogc:LowerBoundary>
        <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
        </ogc:UpperBoundary>
      </ogc:Between>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

is it worth making an issue ?
or it is due to my misunderstood of ogc Specification ?

thank you for your help andrea,

see u next question... :wink:

Andrea Aime a écrit :

Sébastien Geindre ha scritto:

Hi all,

make request on dateTime :

it seems that it is not possible to make Filter on dateTime field with Between tag.

  <wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
   <ogc:Between>
      <ogc:PropertyName>issue_time</ogc:PropertyName>
      <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
      </ogc:LowerBoundary>
      <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
      </ogc:UpperBoundary>
   </ogc:Between>
</ogc:Filter>
</wfs:Query>

It works with this kind of filter T0 < t < T1 :

<wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
      <ogc:And>
        <ogc:PropertyIsGreaterThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T12:00:13</ogc:Literal>
        </ogc:PropertyIsGreaterThan>
        <ogc:PropertyIsLessThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T13:00:13</ogc:Literal>
        </ogc:PropertyIsLessThan>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>

Any reasons ?

Well, basically GeoServer was totally unable of correctly handling
any date/time information until some months ago,
so I'm not surprised there are still glitches here and there.

Please open an issue, we'll see what we can do (thougth I fear
the change needed will be quite extensive, since we'll have
to update all sql encoders as well, so for the moment try to
live with the workaround).

Cheers
Andrea

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr

Sébastien Geindre ha scritto:

In fact it works well if the filter is like that , example 9 page 22 in OGC Filter specification :

   <ogc:Filter>
     <ogc:PropertyIsBetween>
       <ogc:PropertyName>issue_time</ogc:PropertyName>
       <ogc:LowerBoundary>
         <ogc:Literal>2006-12-14T12:08:13</ogc:Literal>
       </ogc:LowerBoundary>
       <ogc:UpperBoundary>
         <ogc:Literal>2006-12-14T12:38:13</ogc:Literal>
       </ogc:UpperBoundary>
     </ogc:PropertyIsBetween>
   </ogc:Filter>

not like that , example 10 page 22 in OGC Filter specification

   <ogc:Filter>
     <ogc:Between>
       <ogc:PropertyName>issue_time</ogc:PropertyName>
       <ogc:LowerBoundary>
         <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
       </ogc:LowerBoundary>
       <ogc:UpperBoundary>
         <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
       </ogc:UpperBoundary>
     </ogc:Between>
   </ogc:Filter>
</wfs:Query>
</wfs:GetFeature>

is it worth making an issue ?

Yes, it is worth, since it's a bug...
just don't hold your breath waiting for it to be fixed,
and use the workaround in the meantime.
But open an issue please, or we'll forget about this.
Cheers
Andrea

Sébastien Geindre wrote:

Hi all,

make request on dateTime :

it seems that it is not possible to make Filter on dateTime field with Between tag.

  <wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
   <ogc:Between>
      <ogc:PropertyName>issue_time</ogc:PropertyName>
      <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
      </ogc:LowerBoundary>
      <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
      </ogc:UpperBoundary>
   </ogc:Between>
</ogc:Filter>
</wfs:Query>

Unless I am mistaken this filter is incorrect. Should "Between" not be "PropertyIsBetween"?

It works with this kind of filter T0 < t < T1 :

<wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
      <ogc:And>
        <ogc:PropertyIsGreaterThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T12:00:13</ogc:Literal>
        </ogc:PropertyIsGreaterThan>
        <ogc:PropertyIsLessThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T13:00:13</ogc:Literal>
        </ogc:PropertyIsLessThan>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>

Any reasons ?

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46934a13288807180515871!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Sébastien Geindre wrote:

In fact it works well if the filter is like that , example 9 page 22 in OGC Filter specification :

    <ogc:Filter>
      <ogc:PropertyIsBetween>
        <ogc:PropertyName>issue_time</ogc:PropertyName>
        <ogc:LowerBoundary>
          <ogc:Literal>2006-12-14T12:08:13</ogc:Literal>
        </ogc:LowerBoundary>
        <ogc:UpperBoundary>
          <ogc:Literal>2006-12-14T12:38:13</ogc:Literal>
        </ogc:UpperBoundary>
      </ogc:PropertyIsBetween>
    </ogc:Filter>

Ignore my last message :).

not like that , example 10 page 22 in OGC Filter specification

    <ogc:Filter>
      <ogc:Between>
        <ogc:PropertyName>issue_time</ogc:PropertyName>
        <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
        </ogc:LowerBoundary>
        <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
        </ogc:UpperBoundary>
      </ogc:Between>
    </ogc:Filter>
  </wfs:Query>
</wfs:GetFeature>

is it worth making an issue ?
or it is due to my misunderstood of ogc Specification ?

thank you for your help andrea,

see u next question... :wink:

Andrea Aime a écrit :

Sébastien Geindre ha scritto:

Hi all,

make request on dateTime :

it seems that it is not possible to make Filter on dateTime field with Between tag.

  <wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
   <ogc:Between>
      <ogc:PropertyName>issue_time</ogc:PropertyName>
      <ogc:LowerBoundary>
          <ogc:Literal>2001-01-15T20:07:48.11</ogc:Literal>
      </ogc:LowerBoundary>
      <ogc:UpperBoundary>
          <ogc:Literal>2001-03-06T12:00:00.00</ogc:Literal>
      </ogc:UpperBoundary>
   </ogc:Between>
</ogc:Filter>
</wfs:Query>

It works with this kind of filter T0 < t < T1 :

<wfs:Query typeName="wims:ice_geom">
    <ogc:Filter>
      <ogc:And>
        <ogc:PropertyIsGreaterThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T12:00:13</ogc:Literal>
        </ogc:PropertyIsGreaterThan>
        <ogc:PropertyIsLessThan>
          <ogc:PropertyName>issue_time</ogc:PropertyName>
          <ogc:Literal>2006-12-14T13:00:13</ogc:Literal>
        </ogc:PropertyIsLessThan>
      </ogc:And>
    </ogc:Filter>
  </wfs:Query>

Any reasons ?

Well, basically GeoServer was totally unable of correctly handling
any date/time information until some months ago,
so I'm not surprised there are still glitches here and there.

Please open an issue, we'll see what we can do (thougth I fear
the change needed will be quite extensive, since we'll have
to update all sql encoders as well, so for the moment try to
live with the workaround).

Cheers
Andrea

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Yes, it is worth, since it's a bug...
just don't hold your breath waiting for it to be fixed,
and use the workaround in the meantime.
But open an issue please, or we'll forget about this.

Hmmm. not sure if I agree as classifying this as a bug. I mean the spec clearly states that the element is named "PropertyIsBetween" no? We could try to support just "Between", but then it would also make sense to support "PropertyIsLessThan" => "LessThan", etc... which may just open up a can of worms.

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,46939b7c8053668746562!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Yes, it is worth, since it's a bug...
just don't hold your breath waiting for it to be fixed,
and use the workaround in the meantime.
But open an issue please, or we'll forget about this.

Hmmm. not sure if I agree as classifying this as a bug. I mean the spec clearly states that the element is named "PropertyIsBetween" no? We could try to support just "Between", but then it would also make sense to support "PropertyIsLessThan" => "LessThan", etc... which may just open up a can of worms.

Aahh... sorry, did not notice the filter specification was
wrong. Sébastien, can you try again with the proper PropertyIsBetween
tag?

Cheers
Andrea

Andrea Aime a écrit :

Justin Deoliveira ha scritto:

Yes, it is worth, since it's a bug...
just don't hold your breath waiting for it to be fixed,
and use the workaround in the meantime.
But open an issue please, or we'll forget about this.

Hmmm. not sure if I agree as classifying this as a bug. I mean the spec clearly states that the element is named "PropertyIsBetween" no? We could try to support just "Between", but then it would also make sense to support "PropertyIsLessThan" => "LessThan", etc... which may just open up a can of worms.

Aahh... sorry, did not notice the filter specification was
wrong. Sébastien, can you try again with the proper PropertyIsBetween
tag?

it is ok with this tag !
so the spec is wrong...?? page 22 in OGC Filter specification
                                     
                                    Open GIS Consortium Inc.
                                             Date: 17-MAY-2001
Reference number of this OpenGIS® project document: OGC 02-059
                                                   Version: 1.0.0
               Category: OpenGIS® Implementation Specification
                                    Status: Adopted Specification
                                 Editor: Panagiotis A. Vretanos
Filter Encoding Implementation Specification

Cheers
Andrea

--
Sébastien Geindre
DPREVI/AERO/DEV
sebastien.geindre __at__ meteo.fr