The lon and lat center values of <wrmap> are now produced with 6 digits after the...
authorphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 20 Sep 2013 12:57:33 +0000 (12:57 +0000)
committerphilipp <philipp@7aebc617-e5e2-0310-91dc-80fb5f6d2477>
Fri, 20 Sep 2013 12:57:33 +0000 (12:57 +0000)
git-svn-id: http://www.winterrodeln.org/svn/wrpylib/trunk@1602 7aebc617-e5e2-0310-91dc-80fb5f6d2477

wrpylib/wrmwmarkup.py

index bcd230f5eac640642fc7d090abd43e30215d13a0..095644c9e4bf0a940cdb748c15df2724d8ca4412 100644 (file)
@@ -498,7 +498,10 @@ def create_wrmap(geojson):
     wrmap_xml = xml.etree.ElementTree.Element('wrmap')
     wrmap_xml.text = '\n\n'
     for k, v in geojson['properties'].iteritems():
-        wrmap_xml.attrib[k] = str(v)
+        if k in ['lon', 'lat']:
+            wrmap_xml.attrib[k] = '{:.6f}'.format(v)
+        else:
+            wrmap_xml.attrib[k] = str(v)
 
     assert geojson['type'] == 'FeatureCollection'
     json_features = geojson['features']