I am writing a program that takes in a .osm file and then calculates some new attributes for that feature.
I am using the python libraries gdal and ogr to help deal with the data. So far OGR has proven to be a very useful library for parsing and accessing the OSM file.
I was wondering if it possible to add an additional field to the OSM file using OGR.
There is a .SetField() function, but it only seems to work on fields that already exist. Is there a way I can design my own field and add it as an extra field to the OSM file?
Bonus points if I can keep the original OSM file intact for testing purposes!
Alternatively, it doesn't have to use OGR, any Python library will do.
-
did you see this post: gis.stackexchange.com/questions/7436/…kttii– kttii2016年06月17日 18:05:58 +00:00Commented Jun 17, 2016 at 18:05
-
2The GDAL OSM driver is read only so adding fields and writing them to .osm file is not possible. I believe that it is possible to join external data by common feature ids.user30184– user301842016年06月17日 21:07:19 +00:00Commented Jun 17, 2016 at 21:07
-
Could you provide a tutorial on how to do that? It would be greatly appreciated.Skylion– Skylion2016年06月20日 13:39:59 +00:00Commented Jun 20, 2016 at 13:39