NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hello,

PyOsmium (and Osmium) has an "area" object, which are:

“synthetic OSM objects”. They can be created from closed ways and multipolygon relations. Areas have all the same attributes as real OSM objects and they have tags, too. In addition they have a set of outer and inner rings describing the MultiPolygon geometry. See the chapter on Areas for details.

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's gravatar image

Rev
11112
accept rate: 0%

edited 06 Dec '18, 16:46

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?

(07 Dec '18, 07:37) Jochen Topf

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.

(07 Dec '18, 07:39) 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.

permanent link

answered 08 Dec '18, 08:21

Jochen%20Topf's gravatar image

Jochen Topf
5.2k55074
accept rate: 31%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×352
×191
×38
×32
×6

question asked: 06 Dec '18, 16:17

question was seen: 2,740 times

last updated: 08 Dec '18, 08:21

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum