|
|
@@ -13,7 +13,7 @@ import mapscript
|
|
|
from string import Template
|
|
|
from osgeo import osr
|
|
|
from osgeo import ogr
|
|
|
-
|
|
|
+import OWSExceptions
|
|
|
|
|
|
class OWS:
|
|
|
|
|
|
@@ -133,7 +133,12 @@ class OWS:
|
|
|
if request.getValueByName("fes"):
|
|
|
self.setFilter(mapobj,request)
|
|
|
|
|
|
- mapobj.OWSDispatch(request)
|
|
|
+ res = mapobj.OWSDispatch(request)
|
|
|
+ if mapscript.MS_DONE == res:
|
|
|
+ raise OWSExceptions.NoValidRequest("No valid OWS Request")
|
|
|
+ elif mapscript.MS_FAILURE == res:
|
|
|
+ pass
|
|
|
+ #raise OWSExceptions.RequestFailed("Request failed")
|
|
|
|
|
|
def getMapObj(self,mapfilename=None):
|
|
|
|
|
|
@@ -273,13 +278,17 @@ def getService():
|
|
|
params = urlparse.parse_qs(qstring)
|
|
|
|
|
|
|
|
|
- owsUrl = urllib.unquote(params["owsUrl"][0])
|
|
|
-
|
|
|
- if params["owsService"][0].lower() == "wfs":
|
|
|
- from wfs import WFS
|
|
|
- return WFS(owsUrl,qstring)
|
|
|
- elif params["owsService"][0].lower() == "wcs":
|
|
|
- from wcs import WCS
|
|
|
- return WCS(owsUrl,qstring)
|
|
|
+ if "owsUrl" in params.keys() and\
|
|
|
+ "owsService" in params.keys():
|
|
|
+ owsUrl = urllib.unquote(params["owsUrl"][0])
|
|
|
+
|
|
|
+ if params["owsService"][0].lower() == "wfs":
|
|
|
+ from wfs import WFS
|
|
|
+ return WFS(owsUrl,qstring)
|
|
|
+ elif params["owsService"][0].lower() == "wcs":
|
|
|
+ from wcs import WCS
|
|
|
+ return WCS(owsUrl,qstring)
|
|
|
+ else:
|
|
|
+ raise OWSExceptions.MissingParameterValue("""owsUrl or owsService""")
|
|
|
|
|
|
|