# HG changeset patch
# User casties
# Date 1330098090 -3600
# Node ID 4ade9b80b56327b3e2730331ffdfa8a4acb5b2c5
# Parent 9bfa7a6858f13a661f3c36c418b975161fb3d52f
more cleanup.
descriptions work better now.
diff -r 9bfa7a6858f1 -r 4ade9b80b563 RestDbGisApi.py
--- a/RestDbGisApi.py Thu Feb 23 21:37:37 2012 +0100
+++ b/RestDbGisApi.py Fri Feb 24 16:41:30 2012 +0100
@@ -481,7 +481,8 @@
kmlPlace['TimeStamp'] = '%s'%beg_yr
if geomField=='point':
- kmlPlace['description'] = ""%desc
+ #kmlPlace['description'] = ""%desc
+ kmlPlace['description'] = desc
kmlPlace['icon'] = '#marker_icon_'+colorField
kmlPlace['coord_x'] = str(xCoord)
@@ -603,114 +604,6 @@
## legacy methods...
- def getKmlUrl(self,schema='chgis',table='mpdl',args={'doc':None,'id':None}):
- logging.debug("getKmlUrl")
- id=args.get('id')
- doc=args.get('doc')
- data = self.getDataForGoogleMap(schema,table,id,doc)
- kml=self.getKMLname(data=data,table=table)
- baseUrl = self.absolute_url()
- return "%s/daten/%s"%(baseUrl,kml)
-
- def getDataForGoogleMap(self,schema='chgis',table='mpdl',id=None,doc=None):
- logging.debug("getDataForGoogleMap")
- qstr="SELECT * FROM "+schema+"."+table
- try:
- if id is not None:
- qstr=qstr+" WHERE "
- for id_item in id.split(","):
- if table=='mpdl':
- qstr=qstr+" mpdl_xmlsource_id = '"+id_item+ "' OR"
- else:
- qstr=qstr+" cast(id as text) LIKE '"+id_item+ "' OR"
- qstr=str(qstr).rsplit(" ",1)[0] #to remove last " and "
- data=self.ZSQLSimpleSearch(qstr)
- return data
- except:
- return qstr
-
-
- def getKMLname(self,data=[],table=""):
- logging.debug("getKMLname")
- #session=context.REQUEST.SESSION
- kml4Marker="
\n"
-
- kml4Marker=kml4Marker+"]]>