Ticket #172 (feature request)

Opened 4 months ago

Last modified 1 month ago

add support for OGC Web Services Common 1.1.0

Status: assigned

Reported by: tomkralidis Assigned to: domlowe (accepted)
Priority: major Milestone:
Component: OWSLib Version:
Keywords: ows common Cc: seang

Related to #170, SOS leverages OWS Common 1.1.0. Forthcoming OGC specs will also leverage OWS Common.

I suggest an initial owslib/ows.py implementation.

By building ows.py, then calling code (i.e. wfs, sos, etc.) will get smaller so as to leverage the common methods, etc.

Sean: I have an initial implementation of OWS ExceptionReport.

Attachments

ows.py (5.1 kB) - added by tomkralidis on 12/11/08 18:17:40.
util.py (1.2 kB) - added by tomkralidis on 12/11/08 18:18:03.

Change History

09/18/08 10:34:47: Modified by tomkralidis

  • cc set to seang.
  • keywords changed from ows to ows common.

Sean: see attachment.

09/18/08 10:39:11: Modified by tomkralidis

Sample invocation:

>>> import ows
>>> ex=ows.OWSExceptionReport("1.0.0", "en-CA", "InvalidParameterValue", "request", "oops!")
>>> ex.toxml()
'<?xml version="1.0" ?><ExceptionReport xmlns="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd"><Exception exceptionCode="InvalidParameterValue" locator="request"><ExceptionText>oops!</ExceptionText></Exception></ExceptionReport>'
>>> 

09/19/08 15:26:31: Modified by tomkralidis

  • type changed from defect to feature request.

09/30/08 06:57:47: Modified by tomkralidis

FYI as part of the integration, we will update the wcs 1.1 classes to leverage ows.py

10/10/08 08:12:45: Modified by domlowe

  • owner changed from tomkralidis to domlowe.
  • status changed from new to assigned.

Tom, we have some suggestions: handle namespacing with a function e.g. (http://proj.badc.rl.ac.uk/csml/browser/Python/trunk/csml/parser.py)

nsGML = 'http://www.opengis.net/gml'

def GML(tag):

return "{"+nsGML+"}"+tag

Consolidate attribute parsing blocks using a function or method.

Move OWS exception class to a separate module. It would be the first server side class in the package. We're interested in how you are using it.

11/11/08 13:44:08: Modified by tomkralidis

Dominic: comments:

    • I've defined a util.py which has a nspath function. The path and namespace are passed to this function, which returns the proper namespace-aware path. Note that this works only for XML paths which use the same namespace throughout. For those that don't, I've left the existing fuctionality. See attached util.py and updated ows.py. If this suffices, I will update sos.py and filter.py in the other tickets
    • Can you elaborate on attribute parsing block functions (example)?
    • I put the server side class in there because I saw it in wms.py, hence going along. I would say take it out if we have no direct use for it (in both ows.py and wms.py)

12/11/08 08:36:01: Modified by domlowe

Re the server side class: WMSError - I can't see that this is used anywhere in wms.py I agree with taking it out if it's not used.

12/11/08 08:41:26: Modified by domlowe

Re Attribute parsing blocks:

This pattern is repeated frequently:

if val is not None:

self.contact.city = val.text else: self.contact.city = None

The suggestion meant you could consolidate this pattern into a function such as: setValue('self.contact.city', val)

12/11/08 08:42:35: Modified by domlowe

Re nspath, I think that is a good thing to have in the util module. We need to do some harmonization but I think building a common util module is a good start!

12/11/08 18:17:40: Modified by tomkralidis

  • attachment ows.py added.

12/11/08 18:18:03: Modified by tomkralidis

  • attachment util.py added.

12/11/08 18:19:51: Modified by tomkralidis

Ok, done:

    • removed Server Exception class
    • updated util.py (new attached) with testXMLValue convenience function
    • updated ows.py (new attached) to use util.testXMLValue()

Next steps?