|
@@ -78,9 +78,6 @@ class OWS:
|
|
|
from owslib.wcs import WebCoverageService
|
|
from owslib.wcs import WebCoverageService
|
|
|
self.capabilities = WebCoverageService(url=self.url,version="1.0.0")
|
|
self.capabilities = WebCoverageService(url=self.url,version="1.0.0")
|
|
|
|
|
|
|
|
- # cache capabilities document
|
|
|
|
|
- open(os.path.join(self.cachedir,"capabilities.xml"),"w").write(ElementTree.tostring(self.capabilities._capabilities))
|
|
|
|
|
-
|
|
|
|
|
def getParams(self):
|
|
def getParams(self):
|
|
|
params = urlparse.parse_qs(self.qstring)
|
|
params = urlparse.parse_qs(self.qstring)
|
|
|
|
|
|
|
@@ -199,9 +196,9 @@ class OWS:
|
|
|
if md5.new(oldCaps).hexdigest() == md5.new(newXml).hexdigest():
|
|
if md5.new(oldCaps).hexdigest() == md5.new(newXml).hexdigest():
|
|
|
newCapsFile = open(os.path.join(self.cachedir,"capabilities.xml"),"w")
|
|
newCapsFile = open(os.path.join(self.cachedir,"capabilities.xml"),"w")
|
|
|
newCapsFile.write(newXml)
|
|
newCapsFile.write(newXml)
|
|
|
- logging.debug("Capabilities unchanged, using existing mapfile %s" % self.getMapfileLocation())
|
|
|
|
|
mapfilename = self.getMapfileLocation()
|
|
mapfilename = self.getMapfileLocation()
|
|
|
if os.path.exists(mapfilename):
|
|
if os.path.exists(mapfilename):
|
|
|
|
|
+ logging.debug("Capabilities unchanged, using existing mapfile %s" % self.getMapfileLocation())
|
|
|
return mapscript.mapObj(mapfilename)
|
|
return mapscript.mapObj(mapfilename)
|
|
|
|
|
|
|
|
|
|
|
|
@@ -262,6 +259,11 @@ class OWS:
|
|
|
# sense for other cases
|
|
# sense for other cases
|
|
|
logging.info("Saving mapfile to %s" % self.mapfilename)
|
|
logging.info("Saving mapfile to %s" % self.mapfilename)
|
|
|
mapobj.save(self.mapfilename)
|
|
mapobj.save(self.mapfilename)
|
|
|
|
|
+
|
|
|
|
|
+ # cache capabilities document
|
|
|
|
|
+ logging.info("Saving service Capabilities to %s" % os.path.join(self.cachedir,"capabilities.xml"))
|
|
|
|
|
+ open(os.path.join(self.cachedir,"capabilities.xml"),"w").write(ElementTree.tostring(self.capabilities._capabilities))
|
|
|
|
|
+
|
|
|
else:
|
|
else:
|
|
|
logging.info("Mapfile NOT saved")
|
|
logging.info("Mapfile NOT saved")
|
|
|
|
|
|