-
Notifications
You must be signed in to change notification settings - Fork 0
/
wcs110.patch
101 lines (91 loc) · 6.3 KB
/
wcs110.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
--- wcs110_orig.py 2013-04-25 18:28:42.328937256 +0200
+++ wcs110.py 2013-06-04 17:17:46.824412914 +0200
@@ -235,7 +235,7 @@
""" Abstraction for ServiceProvider metadata
implements IServiceProviderMetadata """
def __init__(self,elem):
- name=elem.find('{http://www.opengis.net/ows}ProviderName')
+ name=elem.find('{http://www.opengis.net/ows}ProviderName') or elem.find('{http://www.opengis.net/ows/1.1}ProviderName')
if name is not None:
self.name=name.text
else:
@@ -282,7 +282,7 @@
self.country = None
try:
- self.email = elem.find('{http://www.opengis.net/ows}ServiceContact/{http://www.opengis.net/ows}ContactInfo/{http://www.opengis.net/ows}Address/{http://www.opengis.net/ows}ElectronicMailAddress').text
+ self.email = elem.find('{http://www.opengis.net/ows}ServiceContact/{http://www.opengis.net/ows}ContactInfo/{http://www.opengis.net/ows}Address/{http://www.opengis.net/ows}ElectronicMailAddress').text
except AttributeError:
self.email = None
@@ -299,27 +299,28 @@
self._parent=parent
self.id=self._checkChildAndParent('{http://www.opengis.net/wcs/1.1}Identifier')
self.description =self._checkChildAndParent('{http://www.opengis.net/wcs/1.1}Description')
- self.title =self._checkChildAndParent('{http://www.opengis.net/ows}Title')
- self.abstract =self._checkChildAndParent('{http://www.opengis.net/ows}Abstract')
+ self.title =self._checkChildAndParent('{http://www.opengis.net/ows}Title') or self._checkChildAndParent('{http://www.opengis.net/ows/1.1}Title')
+ self.abstract =self._checkChildAndParent('{http://www.opengis.net/ows}Abstract') or self._checkChildAndParent('{http://www.opengis.net/ows/1.1}Abstract')
#keywords.
self.keywords=[]
- for kw in elem.findall('{http://www.opengis.net/ows}Keywords/{http://www.opengis.net/ows}Keyword'):
+ for kw in elem.findall('{http://www.opengis.net/ows}Keywords/{http://www.opengis.net/ows}Keyword') or elem.findall('{http://www.opengis.net/ows}Keywords/{http://www.opengis.net/ows/1.1}Keyword'):
if kw is not None:
self.keywords.append(kw.text)
#also inherit any keywords from parent coverage summary (if there is one)
if parent is not None:
- for kw in parent.findall('{http://www.opengis.net/ows}Keywords/{http://www.opengis.net/ows}Keyword'):
+ for kw in parent.findall('{http://www.opengis.net/ows}Keywords/{http://www.opengis.net/ows}Keyword') or parent.findall('{http://www.opengis.net/ows/1.1}Keywords/{http://www.opengis.net/ows/1.1}Keyword'):
if kw is not None:
self.keywords.append(kw.text)
self.boundingBox=None #needed for iContentMetadata harmonisation
self.boundingBoxWGS84 = None
- b = elem.find('{http://www.opengis.net/ows}WGS84BoundingBox')
+ b = elem.find('{http://www.opengis.net/ows}WGS84BoundingBox') or elem.find('{http://www.opengis.net/ows/1.1}WGS84BoundingBox')
+
if b is not None:
- lc=b.find('{http://www.opengis.net/ows}LowerCorner').text
- uc=b.find('{http://www.opengis.net/ows}UpperCorner').text
+ lc=(b.find('{http://www.opengis.net/ows}LowerCorner') or b.find('{http://www.opengis.net/ows/1.1}LowerCorner')).text
+ uc=(b.find('{http://www.opengis.net/ows}UpperCorner') or b.find('{http://www.opengis.net/ows/1.1}UpperCorner')).text
self.boundingBoxWGS84 = (
float(lc.split()[0]),float(lc.split()[1]),
float(uc.split()[0]), float(uc.split()[1]),
@@ -327,11 +328,11 @@
# bboxes - other CRS
self.boundingboxes = []
- for bbox in elem.findall('{http://www.opengis.net/ows}BoundingBox'):
+ for bbox in elem.findall('{http://www.opengis.net/ows}BoundingBox') or elem.findall('{http://www.opengis.net/ows/1.1}BoundingBox'):
if bbox is not None:
try:
- lc=b.find('{http://www.opengis.net/ows}LowerCorner').text
- uc=b.find('{http://www.opengis.net/ows}UpperCorner').text
+ lc=(b.find('{http://www.opengis.net/ows}LowerCorner') or b.find('{http://www.opengis.net/ows/1.1}LowerCorner')).text
+ uc=(b.find('{http://www.opengis.net/ows}UpperCorner') or b.find('{http://www.opengis.net/ows/1.1}UpperCorner')).text
boundingBox = (
float(lc.split()[0]),float(lc.split()[1]),
float(uc.split()[0]), float(uc.split()[1]),
@@ -396,3 +397,4 @@
except:
value = None
return value
+
@@ -62,7 +62,7 @@ class WebCoverageService_1_1_0(WCSBase):
self.identification=ServiceIdentification(elem)
#serviceProvider
- elem=self._capabilities.find('{http://www.opengis.net/ows/1.1}ServiceProvider')
+ elem=self._capabilities.find('{http://www.opengis.net/ows/1.1}ServiceProvider') or self._capabilities.find('{http://www.opengis.net/ows}ServiceProvider')
self.provider=ServiceProvider(elem)
#serviceOperations
@@ -209,10 +209,14 @@ class ServiceIdentification(object):
self.title=testXMLValue(elem.find('{http://www.opengis.net/ows/1.1}Title'))
if self.title is None: #may have used the wcs ows namespace:
self.title=testXMLValue(elem.find('{http://www.opengis.net/wcs/1.1/ows}Title'))
+ if self.title is None: #may have used the other wcs ows namespace:
+ self.title=testXMLValue(elem.find('{http://www.opengis.net/ows}Title'))
self.abstract=testXMLValue(elem.find('{http://www.opengis.net/ows/1.1}Abstract'))
if self.abstract is None:#may have used the wcs ows namespace:
self.abstract=testXMLValue(elem.find('{http://www.opengis.net/wcs/1.1/ows}Abstract'))
+ if self.title is None: #may have used the other wcs ows namespace:
+ self.title=testXMLValue(elem.find('{http://www.opengis.net/ows}Abstract'))
if elem.find('{http://www.opengis.net/ows/1.1}Abstract') is not None:
self.abstract=elem.find('{http://www.opengis.net/ows/1.1}Abstract').text
else: