Hello, PyOsmium (and Osmium) has an "area" object, which are:
I want to add some tags on "areas" (really, on building objects), but it seems there is no possibility of doing so (area tags are non mutable) and getting an osc file out of this. What I need from building is a closed polygon representing the building, and using areas made it easy to have this representation. Should I go and edit ways directly? It will miss building defined by relations, so i'm not really happy with this approach. How would you go and edit "buildings" programmatically? asked 06 Dec '18, 16:17 Rev |
It doesn't make sense to change the "areas", because they are not real OSM objects. "Areas" in Osmium are a fiction that makes sense when you want to export OSM data into some other format. Osmium creates those areas from the OSM data and then you can transform them into some format (like GeoJSON or so) that understands Polygons. But you can not use them to do something with the OSM data, because that still has ways and relations. So you have to change all closed ways and all multipolygon relations which isn't that hard anyway. All OSM objects (nodes, ways, relations and the pseudo-objects areas) are read-only in Osmium for performance reasons, so to change them you have to create a new object as a copy of the old one with the changes you want. answered 08 Dec '18, 08:21 Jochen Topf |
There seems to be some confusion here on how OSM data works and how Osmium/PyOsmium works with OSM data, but it is difficult to help you without understanding better what you want to achieve. Can you explain what your end goal is here, not in terms of the workings of Osmium, but on a higher level?
Areas are closed ways or multipolygons. What I want to do is to be able to modify "areas" (adding some tags to them) without having to understand if they are ways or multipolygons.