Mercurial > hg > ChinaGisRestApi
diff RestDbGisApi.py @ 138:771e7b3af615
polygon-Layers
author | fknauft |
---|---|
date | Thu, 03 Feb 2011 11:02:24 +0100 |
parents | 176864b3eceb |
children | 3adea92d2067 |
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