Ticket #172 (closed feature request: fixed)

Opened 23 months ago

Last modified 14 months ago

add support for OGC Web Services Common 1.1.0

Reported by: tomkralidis Owned by: domlowe
Priority: major Milestone:
Component: OWSLib Version:
Keywords: ows common Cc: seang

Description

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 20 months ago.
util.py (1.2 KB) - added by tomkralidis 20 months ago.

Change History

Changed 23 months ago by tomkralidis

  • cc seang added
  • keywords common added

Sean: see attachment.

Changed 23 months ago 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>'
>>> 

Changed 23 months ago by tomkralidis

  • type changed from defect to feature request

Changed 22 months ago by tomkralidis

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

Changed 22 months ago 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.

Changed 21 months ago 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)

Changed 20 months ago 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.

Changed 20 months ago 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)

Changed 20 months ago 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!

Changed 20 months ago by tomkralidis

Changed 20 months ago by tomkralidis

Changed 20 months ago 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?

Changed 14 months ago by tomkralidis

convenience functions (util.py) added in r1285.

Changed 14 months ago by tomkralidis

  • status changed from assigned to closed
  • resolution set to fixed

added to trunk in r1299

Note: See TracTickets for help on using tickets.