Jachym Cepicky 14 лет назад
Родитель
Сommit
603b8296ff
3 измененных файлов с 14 добавлено и 8 удалено
  1. 6 5
      OWS.py
  2. 7 3
      wcs/__init__.py
  3. 1 0
      wcs/templates/wcs.xml

+ 6 - 5
OWS.py

@@ -70,10 +70,11 @@ class OWS:
         # 1.0.0 works
         # 1.1.0 reverses axes, while OGR is requesting the FeatureType
         # using BBOX FILTER
-        if "version" in params:
-            params["version"] = "1.0.0"
-        else:
-            params["VERSION"] = "1.0.0"
+        if self.service == "WFS":
+            if "version" in params:
+                params["version"] = "1.0.0"
+            else:
+                params["VERSION"] = "1.0.0"
 
 
         url = urlparse.urlunparse((self.parsedUrl[0],
@@ -122,7 +123,6 @@ class OWS:
         params["owsService"] = self.service
         params["map"] = self.getMapfileLocation(mapfilename)
 
-
         location = urlparse.urlunparse((o[0],o[1],o[2],o[3],urllib.urlencode(params,True),o[5]))
         logging.debug("Setting OnlineResource to %s"% location)
         return location
@@ -263,3 +263,4 @@ def getService():
         from wcs import WCS
         return WCS(owsUrl,qstring)
     
+

+ 7 - 3
wcs/__init__.py

@@ -9,20 +9,25 @@ from string import Template
 import os
 import logging
 
-
 class WCS(OWS):
 
     service = "WCS"
     request = '' # GetCapabilies, ...
+    parser = None
+    version = None
+    wcsns = None
 
     def __init__(self,url=None,qstring=None,configFiles=None):
         OWS.__init__(self,url,qstring)
 
     def makeMap(self,mapfilename=None):
+        self.version = self.capabilities.attrib["version"]
+        self.wcsns = self.capabilities.nsmap[self.capabilities.prefix]
+
 
         mapobj = self.getMapObj(mapfilename)
 
-        for layer in self.capabilities.Contents.getchildren():
+        for layer in self.capabilities["{%s}Contents" % (self.wcsns)].getchildren():
             name =  layer.Identifier.text
             logging.debug("Creating layer %s" % name)
 
@@ -49,4 +54,3 @@ class WCS(OWS):
 
         self.saveMapfile(mapobj,mapfilename)
         return mapobj
-

+ 1 - 0
wcs/templates/wcs.xml

@@ -1,4 +1,5 @@
 <WCS_GDAL>
   <ServiceURL>$url</ServiceURL>
   <CoverageName>$name</CoverageName>
+  <Timeout>5000</Timeout>
 </WCS_GDAL>