changeset 260:e9a1ac7d2ab2

Bug resolved in request point_id from Harvard ChGIS
author fknauft
date Fri, 07 Oct 2011 12:25:21 +0200
parents 17b2c2dba0fd
children 5b38b50052e4
files RestDbGisApi.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbGisApi.py	Wed Sep 28 19:08:52 2011 +0200
+++ b/RestDbGisApi.py	Fri Oct 07 12:25:21 2011 +0200
@@ -370,7 +370,7 @@
         return kmlData
 
     def getPointForChGisId(self, gis_id):
-        """returns coordinate pair for given gis_id"""
+        """returns coordinate pair for given gis_id"""   # gets called by getKml
         def getPoint(id):
             str_gis_id=str(id).split('.')[0]
             sql="SELECT x_coord,y_coord FROM chgis.chgis_coords WHERE gis_id LIKE CAST('%s' AS text)"%str(str_gis_id)
@@ -385,6 +385,8 @@
         
         if gis_id is None or gis_id == "":
             return None
+        if len(gis_id) < 4:
+            return None
         
         # try gis_id
         coords = getPoint(gis_id)