changeset 142:3adea92d2067

polygon-Layers
author fknauft
date Thu, 03 Feb 2011 12:36:53 +0100
parents 97cb016e29ec
children 6d9ff64bb16b
files RestDbGisApi.py
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbGisApi.py	Thu Feb 03 12:20:06 2011 +0100
+++ b/RestDbGisApi.py	Thu Feb 03 12:36:53 2011 +0100
@@ -295,16 +295,18 @@
                 kmlData.append(kmlPlace)
             if geomField=='poly' and len(geomdata)>0:
                 geom_list=geomdata.values()
-                coords=str(geom_list[1]).split('(')[4].split(')')[0].split(',')
-                coord_string=''
-                for coord in coords:
-                    coord=coord.split(' ')
-                    try:
-                        x_coord=coord[0]
-                        y_coord=coord[1]
-                    except:
-                        break
-                    coord_string+=x_coord+','+y_coord+','+'0 \n'
+                polys=str(geom_list[1]).split('(')[4].split(')')
+                for poly in polys:
+                    coords=poly.split(',')
+                    coord_string=''
+                    for coord in coords:
+                        coord=coord.split(' ')
+                        try:
+                            x_coord=coord[0]
+                            y_coord=coord[1]
+                        except:
+                            break
+                        coord_string+=x_coord+','+y_coord+','+'0 \n'
                 kmlPlace['LinearRing']=coord_string              
                 kmlPlace['LineColor']=colorField
                 kmlData.append(kmlPlace)