Skip to content

Commit

Permalink
Fixed the method lookup for get_observation. Was failing on indexing …
Browse files Browse the repository at this point in the history
…array using a string. The returned type is an array of dicts and needs searching to pull out the correct HTTP method URL
  • Loading branch information
peterataylor committed Jul 10, 2014
1 parent 7119acb commit 909a1c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion owslib/swe/observation/sos200.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def get_observation(self, responseFormat=None,
anything else e.g. vendor specific parameters
"""

base_url = self.get_operation_by_name('GetObservation').methods[method]['url']
# Pluck out the get observation URL for HTTP method - methods is an
# array of dicts
methods = self.get_operation_by_name('GetObservation').methods
base_url = [ m['url'] for m in methods if m['type'] == method][0]

request = {'service': 'SOS', 'version': self.version, 'request': 'GetObservation'}

Expand Down

0 comments on commit 909a1c2

Please sign in to comment.