[OWSLib-users] OGC time filter on WFS

Tom Kralidis tomkralidis at gmail.com
Wed Apr 10 04:54:21 PDT 2019


Hi Laurent: this functionality exists in OWSLib's CSW client, but not
WFS.  You will have to construct the filter XML and pass to OWSLib's
WFS getfeature function via the filter property.

..Tom

On Wed, 10 Apr 2019, Laurent Besnard wrote:

> Date: Wed, 10 Apr 2019 05:55:01 +0000
> From: Laurent Besnard <laurent.besnard at utas.edu.au>
> To: "owslib-users at lists.osgeo.org" <owslib-users at lists.osgeo.org>
> Subject: [OWSLib-users] OGC time filter on WFS
> 
> Hi there,
>
>
> I've been searching a bit everywhere in the code/issues ... regarding an OGC time filter capability in OWSLib without any success.
>
> The only way I have managed to achieve this so far was do write some dirty xml in my own code. But I'm sure I'm missing something:
>
> from owslib.fes import PropertyIsGreaterThan
>
> wfs_filter_time = "2019-02-18T03:04:00"
> wfs_property_filter_time = 'TIME'
> wfs_date_format="yyyy-MM-dd'T'HH:mm:ss"
> wfs_filter_slevelmax = PropertyIsGreaterThan(propertyname=wfs_property_filter_time,
>                                             literal=wfs_filter_time)
>
> # since the function feature doesn't seem to exist, have to create the query manually
> filterxml_time = '<ogc:{property_filter_type} xmlns:ogc="http://www.opengis.net/ogc"><ogc:PropertyName>{wfs_property_filter_time}</ogc:PropertyName>' \
>                 '<Function name="dateParse"><Literal>{wfs_date_format}</Literal><ogc:Literal>{wfs_filter_time}</ogc:Literal></Function>' \
>                 '</ogc:{property_filter_type}>'.format(property_filter_type='PropertyIsGreaterThan',
>                                                        wfs_property_filter_time=wfs_property_filter_time,
>                                                        wfs_filter_time=wfs_filter_time,
>                                                        wfs_date_format=wfs_date_format)
>
>
> Is there some proper way to do the equivalent with OWSLib ?
>
> Regards
> Loz
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Laurent Besnard, AODN Project Officer
> Private Bag 110, University of Tasmania, IMAS Building, Hobart, 7001 Australia
> Email: Laurent.Besnard at utas.edu.au, URL: http://portal.aodn.org.au
> Tel 0448 710 476
>
>
> University of Tasmania Electronic Communications Policy (December, 2014).
> This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
>


More information about the OWSLib-users mailing list