Blender-osm: OpenStreetMap and terrain for Blender


(RichOBrien) #101

Traceback (most recent call last):
  File "C:\Users\User1\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender-osm\", line 173, in execute
  File "C:\Users\User1\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender-osm\", line 213, in render
  File "C:\Users\User1\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender-osm\building\", line 171, in render
    self.renderer.render(building, self.osm)
  File "C:\Users\User1\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender-osm\building\", line 31, in render
    self.renderElement(outline, building, osm)
  File "C:\Users\User1\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender-osm\building\", line 45, in renderElement
    self.renderMultiPolygon(element, osm)
  File "C:\Users\User1\AppData\Roaming\Blender Foundation\Blender\2.78\scripts\addons\blender-osm\renderer\", line 322, in renderMultiPolygon
    f =, _vt, _vb, ub))
ValueError: face already exists

location: <unknown location>:-1

Any ideas? Just purchased and tried a simple .osm import.

(vvoovv) #102


Please send your osm file that caused the problem to this e-mail address. I’ll try to fix the problem as soon as possible.

(JuhaW) #103

Sometimes it does not see buildings if they are separated parts on .osm file but irl they are parts of the same building.
.osm file

(vvoovv) #104


Import is performed correctly in that case according to the Simple 3D buildings specification:

Building outline area containing ways tagged with building: part=* is not considered for volume rendering.

So in your example there is a building part mapped with building: part=yes located inside a building outline mapped with building=yes.

According to the specification the building part will be rendered in 3D and the building outline won’t be rendered in 3D. So the addon performs import correctly.

But I moved forward and mapped that building correctly in the OSM database. So you can download that area again and import it to Blender.

(vvoovv) #105

Funny. The forum software replaced colon : followed by the letter p with a smiley in my previous message.

(vvoovv) #106


I’m repeating here what I sent in the private message.

Your file contained incorrect mapping according to the OSM specification. Since it’s encountered quite rare in the OSM, I opted to fix it the OSM database. You can download your area again and import it to Blender.

(vvoovv) #107


I totally agree with this recommendation. 1.6 Gb OSM file probably contains around half a million buildings.

It’s possible to create an OSM file for an arbitrary area of interest with the service

  • Start typing the name of your place of interest in the input field. A popup list appears.
  • Don’t choose a ready to download file under POPULAR EXTRACTS READY FOR DOWNLOAD NOW, if your area of interest has one
  • Choose an appropriate item under TO MAKE A CUSTOM EXTRACT
  • Adjust the selection box on the map
  • Follow further instruction and wait around 1 hour till your OSM extract is ready. You will be asked to register at via your account

(vvoovv) #108

I overlooked somehow a much simplier way to download a custom OSM extract:

  • Zoom to your area of interest at
  • Press Manually select a different area on the left
  • Adjust the selection box on the map
  • Press Overpass API link on the left

(JuhaW) #109

How is that upper part supposed to be tagged ?
I tried tag both parts building yes but then upper part has no floor.


(vvoovv) #110

I remapped the building to reflect its structure in a better way:

Map building parts with building: part=yes and height tags explained below. Then create an outline the covers all building parts and map it with building=yes. Assign building address to the outline, not to building parts.

Important note. There must be no space between colon : and the word part. I placed the space intentionally there, because the forum software replaces colon : and the letter p with a smiley.

The height tags are explained on the image below:

Use the tag building:levels to set the height of a building part expressed in levels or floors.

Important! Note that the middle part of building on the image above has building:levels=7 (NOT building:levels=2)

Use the tag building:min_level to set the offset of a building part above the ground expressed in levels or floors.
You don’t need to set building:min_level=0 if a building part is located on the ground.

If you know the height of a building part in meters apply the tags height and min_height in the similar manner to the building part.

A tip. When you edit OSM in the JOSM editor, keep ALT key pressed and click on an edge multiple times to select the proper OSM element sharing that edge.

(vvoovv) #111

I am proud to announce the new release of the OSM addon!

The addon now supports a number of roof shapes: flat, pyramidal, mono-pitched, dome, onion.

Get the addon for just $2.85:

P.S. OSM file for Moscow Kremlin shown on the image can be downloaded from here.

(JuhaW) #112

Thanks for the info and the new release.
I found you set tags to custom object properties which makes easy to set materials with script.
Is it possible you set tags “building:colour” and “roof:colour” for objects if they dont have “roof” and “wall” materials ?

(burnin) #113

Thank you, vvoovv, getting really nice.
Now i need to start working on OSM buildings… here everything is flat (no tags, descriptions) :eek: damn… :smiley:

(vvoovv) #114


Yes, OSM tags are set as Blender custom properties for a Blender object representing OSM building outline if the option Import as a single object is unchecked

I set all OSM tags without any exception. So if a building outline tagged with building=yes has a tag building:colour or roof:colour, it will be also set as custom Blender property.

A building in OSM can have complex structure, i.e composed of several parts tagged with building:part=yes. In that case the building part can have its own tags building:colour or roof:colour. However the building part won’t get a separate Blender object. All parts of the same building will form the same single Blender object with custom properties taken from the building outline tagged with building=yes.
Maybe you should describe what you are going to achive at the end.

(vvoovv) #115


That’s certainly a good idea. All will benefit from your mapping in OSM. I’ve been mapping in OSM since 2008.

Here is a good introduction how to map 3D features for OSM buildings.

(JuhaW) #116

This building is a good example: no colour tags to refer which material is for roofs and which for walls.
In that case material slots0 and 2 are roof materials and slot1 is wall material.
It would be nice to have tags building:colour ab8f81, roof:colour a9a492 roof:colour 60686d, like you have already on many objects.

(vvoovv) #117


Different parts of the same buiding can have different colors. Your snapshot also illustrates that case. Three building parts on the top have yellow roof color, and the other building parts have reddish roof color. It isn’t possible to have 2 or more Blender custom properties with the same key like roof:colour=a9a492 and roof:colour=60686d.

Also the same Blender material can be used both for roof and walls.

I can assign vertex groups to roof and wall faces. In this way you can separate roofs from walls and know for sure which Blender material is used for roofs and which one for walls.

(JuhaW) #118

Is it possible then use the same tag but multiple values like roof:colour=roof1;roof2;roof3, so those would be roof materials ?

(burnin) #119

Great effort!
Yeah, big goals, while others couldn’ care less, even if we get back into the stone age again :smiley:
Am devoting time on learning from OSM wiki, appreciative of any link. Thank you.
And i continue having hope on terrain support.

Good call. +1

(vvoovv) #120


Please write how you are going to use the information about roof and wall colors. Maybe I can provide a more consistent solution if you explain your final goal.