0

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.

asked Jun 17, 2016 at 17:30
3
  • did you see this post: gis.stackexchange.com/questions/7436/… Commented Jun 17, 2016 at 18:05
  • 2
    The 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. Commented Jun 17, 2016 at 21:07
  • Could you provide a tutorial on how to do that? It would be greatly appreciated. Commented Jun 20, 2016 at 13:39

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.