[OWSLib-users] OGC time filter on WFS

Laurent Besnard laurent.besnard at utas.edu.au
Tue Apr 9 22:55:01 PDT 2019


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-users/attachments/20190410/4c72d2cf/attachment.html>


More information about the OWSLib-users mailing list