changeset 138:771e7b3af615

polygon-Layers
author fknauft
date Thu, 03 Feb 2011 11:02:24 +0100
parents 176864b3eceb
children c570e374935e
files RestDbGisApi.py zpt/KML_schema_table.zpt
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/RestDbGisApi.py	Thu Feb 03 10:49:11 2011 +0100
+++ b/RestDbGisApi.py	Thu Feb 03 11:02:24 2011 +0100
@@ -295,12 +295,15 @@
                 kmlData.append(kmlPlace)
             if geomField=='poly' and len(geomdata)>0:
                 geom_list=geomdata.values()
-                coords=str(geom_list[1]).split('(')[4].split(',')
+                coords=str(geom_list[1]).split('(')[4].split(')')[0].split(',')
                 coord_string=''
                 for coord in coords:
                     coord=coord.split(' ')
-                    x_coord=coord[0]
-                    y_coord=coord[1]
+                    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
--- a/zpt/KML_schema_table.zpt	Thu Feb 03 10:49:11 2011 +0100
+++ b/zpt/KML_schema_table.zpt	Thu Feb 03 11:02:24 2011 +0100
@@ -75,7 +75,7 @@
       ERD-0815: ERD-0815
       </description>
       <Style>
-         <PolyStyle><color tal:content="place/LineColor">#80800000</color><fill>1</fill><outline>1</outline></PolyStyle></Style>
+         <PolyStyle><color tal:content="place/LineColor">#80800000</color><fill>0.1</fill><outline>1</outline></PolyStyle></Style>
       <MultiGeometry><Polygon><outerBoundaryIs><LinearRing><coordinates tal:content="string:${place/LinearRing}">116.38,39.92,0</coordinates>
           </LinearRing></outerBoundaryIs></Polygon></MultiGeometry>
     </Placemark>