|
|
@@ -25,6 +25,7 @@ class OWS:
|
|
|
config = None
|
|
|
parsedUrl = None
|
|
|
service = None
|
|
|
+ mapfilename = None
|
|
|
|
|
|
def __init__(self,url=None,qstring=None,configFile=None):
|
|
|
self.requestUrl = url
|
|
|
@@ -68,7 +69,7 @@ class OWS:
|
|
|
self.parsedUrl[1],
|
|
|
self.parsedUrl[2],
|
|
|
self.parsedUrl[3],
|
|
|
- urllib.urlencode(params),
|
|
|
+ urllib.unquote(urllib.urlencode(params,True)),
|
|
|
self.parsedUrl[5]))
|
|
|
e = objectify.parse(urllib.urlopen(url))
|
|
|
self.capabilities = e.getroot()
|
|
|
@@ -97,7 +98,7 @@ class OWS:
|
|
|
self.parsedUrl[1],
|
|
|
self.parsedUrl[2],
|
|
|
self.parsedUrl[3],
|
|
|
- urllib.urlencode(params),
|
|
|
+ urllib.urlencode(params,True),
|
|
|
self.parsedUrl[5]))
|
|
|
|
|
|
def getParams(self):
|
|
|
@@ -111,7 +112,7 @@ class OWS:
|
|
|
params["map"] = self.getMapfileLocation(mapfilename)
|
|
|
|
|
|
|
|
|
- location = urlparse.urlunparse((o[0],o[1],o[2],o[3],urllib.urlencode(params),o[5]))
|
|
|
+ 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
|
|
|
|
|
|
@@ -195,16 +196,18 @@ class OWS:
|
|
|
|
|
|
def saveMapfile(self,mapobj,mapfilename):
|
|
|
|
|
|
- mapfilename = self.getMapfileLocation(mapfilename)
|
|
|
- if mapfilename:
|
|
|
+ self.mapfilename = self.getMapfileLocation(mapfilename)
|
|
|
+ if self.mapfilename:
|
|
|
|
|
|
# save mapfile ONLY if GetCapabilities requested - it makes no
|
|
|
# sense for other cases
|
|
|
- logging.info("Saving mapfile to %s" % mapfilename)
|
|
|
- mapobj.save(mapfilename)
|
|
|
+ logging.info("Saving mapfile to %s" % self.mapfilename)
|
|
|
+ mapobj.save(self.mapfilename)
|
|
|
else:
|
|
|
logging.info("Mapfile NOT saved")
|
|
|
|
|
|
+ return self.mapfilename
|
|
|
+
|
|
|
def getLayerUrl(self):
|
|
|
|
|
|
layerurl = self.url
|
|
|
@@ -234,6 +237,7 @@ def getService():
|
|
|
|
|
|
qstring = os.environ["QUERY_STRING"]
|
|
|
params = urlparse.parse_qs(qstring)
|
|
|
+
|
|
|
|
|
|
owsUrl = urllib.unquote(params["owsUrl"][0])
|
|
|
|