Update support for wrregion and wrregioncache.
[philipp/winterrodeln/wrpylib.git] / 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']