Mercurial > hg > ChinaGisRestApi
changeset 41:f94fc5a51a38
Merge with 0c769ba7957ce73c2f97dc15014928df8418fdbc
author | casties |
---|---|
date | Wed, 01 Sep 2010 21:04:47 +0200 |
parents | fbd3ce67c821 (diff) 0c769ba7957c (current diff) |
children | 291aed5f0e0d |
files | RestDbInterface.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/RestDbInterface.py Wed Sep 01 21:01:49 2010 +0200 +++ b/RestDbInterface.py Wed Sep 01 21:04:47 2010 +0200 @@ -626,8 +626,9 @@ # Mapping a set of points from table-based SQL-query: if data!=None: try: - SQL="""SELECT \"attribute with gis_id\" FROM public.metadata WHERE tablename LIKE '"""+table+"""'""" - gisIDattribute=self.ZSQLSimpleSearch(SQL) + SQL='SELECT "attribute with gis_id" FROM public.metadata WHERE tablename = %s' + res = self.executeSQL(SQL, (table,)) + gisIDattribute = res['rows'][0][0] except: return "table not registered within metadata" @@ -641,7 +642,7 @@ yCoord=getattr(dataset,'y_coord') except: #try: - gisID=getattr(dataset,getattr(gisIDattribute[0],'attribute with gis_id')) + gisID=getattr(dataset,gisIDattribute) coords=self.getPoint4GISid(gisID) if coords!=None: xCoord=coords[0]