[GRASS-SVN] r47978 - grass-addons/grass7/gui/wxpython/wx.wms
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 30 12:29:55 EDT 2011
Author: sudeepsingh
Date: 2011-08-30 09:29:55 -0700 (Tue, 30 Aug 2011)
New Revision: 47978
Modified:
grass-addons/grass7/gui/wxpython/wx.wms/parse.py
grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py
Log:
functioanlity added- Non Querayable layers cant be selected now
Modified: grass-addons/grass7/gui/wxpython/wx.wms/parse.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/parse.py 2011-08-30 16:09:12 UTC (rev 47977)
+++ grass-addons/grass7/gui/wxpython/wx.wms/parse.py 2011-08-30 16:29:55 UTC (rev 47978)
@@ -35,6 +35,7 @@
title = None
abstract = None
srsList = None
+ queryable = None
class LayerData():
name = None
@@ -217,6 +218,15 @@
id = ltr
if(hasattr(node,'tagName')):
if(node.tagName == 'Layer' or node.tagName == 'layer'):
+ queryable = None
+ try:
+ print 'hoopla'
+ queryable = node.attributes["queryable"].value
+ except Exception,e:
+ print 'ghapla'
+ print e
+ queryable = 1
+
name = getAttributeLayers(node, 'name')
if(name is not None):
lData[str(key)] = newLayerData()
@@ -231,8 +241,8 @@
abstract = unicode('')
else:
abstract = ':'+abstract
-
- description = unicode(str(key)+'-'+name+title+abstract)
+ queryablestr = ':<Queryable = '+str(queryable)+'>'
+ description = unicode(str(key)+'-'+name+title+abstract+queryablestr)
id = LayerTree.AppendItem(ltr,description)
SRS = node.getElementsByTagName('SRS')
@@ -241,11 +251,12 @@
#print srs.toxml()
#print srs.firstChild.nodeValue
srsList += [str(srs.firstChild.nodeValue)[5:]]
- print srsList
+ #print srsList
lData[str(key)].name = name
lData[str(key)].abstract = abstract
lData[str(key)].title = title
lData[str(key)].srsList = srsList
+ lData[str(key)].queryable = queryable
key = key + 1
Modified: grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py
===================================================================
--- grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py 2011-08-30 16:09:12 UTC (rev 47977)
+++ grass-addons/grass7/gui/wxpython/wx.wms/wmsmenu.py 2011-08-30 16:29:55 UTC (rev 47978)
@@ -40,6 +40,7 @@
title = None
abstract = None
srsList = None
+ queryable = None
@@ -101,13 +102,15 @@
def layerTreeItemDFS(self,parent,LayerTree,nodeId):
if(not nodeId.IsOk()):
return
+
currentLayerDetails = LayerTree.GetItemText(nodeId)
currentLayerName = (currentLayerDetails.split(':')[0]).split('-')[1]
currentLayerKey = (currentLayerDetails.split(':')[0]).split('-')[0]
- parent.epsgList.Append('<'+currentLayerName+'>')
- listEPSG = parent.layerDataDict1[currentLayerKey].srsList
- parent.epsgList.AppendItems(listEPSG)
- parent.layersString += ',' + currentLayerName
+ if(parent.layerDataDict1[currentLayerKey].queryable == 1):
+ parent.epsgList.Append('<'+currentLayerName+'>')
+ listEPSG = parent.layerDataDict1[currentLayerKey].srsList
+ parent.epsgList.AppendItems(listEPSG)
+ parent.layersString += ',' + currentLayerName
allChild = self.getAllChild(LayerTree, nodeId)
for child in allChild:
self.layerTreeItemDFS(parent,LayerTree,child)
@@ -422,7 +425,7 @@
self.selectedLayerList = []
keys =[]
self.layerName = ""
- print len(self.LayerTree.GetSelections())
+ #print len(self.LayerTree.GetSelections())
res = ''
self.layersString=''
manageLT = ManageLayerTree()
@@ -434,7 +437,7 @@
#print child
print self.layersString[1:]
self.layerName = self.layersString[1:]
- print self.layerDataDict1
+ #print self.layerDataDict1
self.selectedEPSG = None
'''
More information about the grass-commit
mailing list