changeset 136:42d7cd64e87c

polygon-Layers
author fknauft
date Thu, 03 Feb 2011 10:45:35 +0100
parents ac22bb1e3212
children 176864b3eceb
files RestDbGisApi.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbGisApi.py	Wed Feb 02 18:34:49 2011 +0100
+++ b/RestDbGisApi.py	Thu Feb 03 10:45:35 2011 +0100
@@ -295,10 +295,15 @@
                 kmlData.append(kmlPlace)
             if geomField=='poly' and len(geomdata)>0:
                 geom_list=geomdata.values()
-                strvalue=str(geom_list[1])
-                kmlPlace['LinearRing']=str(geom_list[1]).split('(')[4]                
+                coords=str(geom_list[1]).split('(')[4].split(',')
+                coord_string=''
+                for coord in coords:
+                    x_coord=coord.split(' ')[0]
+                    y_coord=coord.split(' ')[1]
+                    coord_string+=x_coord+','+y_coord+','+'0 \n'
+                kmlPlace['LinearRing']=coord_string              
+                kmlPlace['LineColor']=colorField
                 kmlData.append(kmlPlace)
-                kmlPlace['LineColor']=colorField
         #logging.debug("kmlData=%s"%(repr(kmlData)))
         return kmlData