|
|
@@ -15,6 +15,7 @@ import os
|
|
|
class WFS(OWS):
|
|
|
|
|
|
service = "WFS"
|
|
|
+ wfsns = "http://www.opengis.net/wfs"
|
|
|
|
|
|
def __init__(self,url=None,qstring=None,configFiles=None):
|
|
|
OWS.__init__(self,url,qstring)
|
|
|
@@ -28,6 +29,8 @@ class WFS(OWS):
|
|
|
|
|
|
ds = ogr.Open(layerDefFile)
|
|
|
|
|
|
+ self.setMapName(mapobj)
|
|
|
+
|
|
|
for layer in self.capabilities.FeatureTypeList.getchildren():
|
|
|
if layer.tag != "{http://www.opengis.net/wfs}FeatureType":
|
|
|
continue
|
|
|
@@ -39,6 +42,8 @@ class WFS(OWS):
|
|
|
lyrobj.name = name
|
|
|
lyrobj.title = layer.Title.text
|
|
|
lyrobj.setMetaData("wms_title",layer.Title.text)
|
|
|
+ if "{%s}%s" % ("http://www.opengis.net/wfs","Abstract") in layer:
|
|
|
+ lyrobj.setMetaData("ows_abstract", layer["{%s}%s" % ("http://www.opengis.net/wfs","Abstract")].text)
|
|
|
lyrobj.setMetaData("wfs_typename",layer.Name.text)
|
|
|
lyrobj.setMetaData("wfs_version",self.capabilities.attrib["version"])
|
|
|
lyrobj.setConnectionType(mapscript.MS_OGR,'')
|
|
|
@@ -98,3 +103,13 @@ class WFS(OWS):
|
|
|
else:
|
|
|
return mapscript.MS_LAYER_POINT
|
|
|
|
|
|
+ def setMapName(self,mapobj):
|
|
|
+ mapobj.name = self.config.get("MapServer","name")
|
|
|
+
|
|
|
+ if self.capabilities.attrib["version"] == "1.0.0":
|
|
|
+ mapobj.setMetaData("wms_title",self.capabilities["{%s}%s"%(self.wfsns,"Service")].Title.text)
|
|
|
+ mapobj.setMetaData("wms_abstract",self.capabilities.Service.Abstract.text)
|
|
|
+
|
|
|
+ else:
|
|
|
+ mapobj.setMetaData("wms_title",self.capabilities["{%s}%s"%(self.owsns,"ServiceIdentification")].Title.text)
|
|
|
+ mapobj.setMetaData("wms_abstract",self.capabilities["{%s}%s"%(self.owsns,"ServiceIdentification")].Abstract.text)
|