Blosm: Import of Google 3D Cities, OpenStreetMap, Terrain

blender-osm provides one click download and import of OpenStreetMap and real world terrain data for Blender with global coverage. Two versions of the addon are available:

They are briefly described below.

blender-osm (premium)

In addition to the features of the base version, the premium one provides:

  • Import of buildings from OpenStreetMap with default materials, tileable building textures and UV-mapping applied
  • Default materials and textures to mimic lit windows for a late evening setting
  • Import of forests and single trees as 3D objects
  • Options to use custom tileable building textures (e.g. from textures.com)
  • Satellite imagery and web maps projected on a terrain

Buy the addon at gumroad.com! By purchasing the addon you support the addon development. All customers will get the addon source code under GPL license! All default textures and materials supplied with addon are released under the CC0 (public license)!

The detailed documentation is available here.

blender-osm (the base version)

  • blender-osm imports buildings from OpenStreetMap without any texture applied. Building height and number of floors are used to create the final scene. Composition into 3D parts for a building with the complex structure is also processed. A large number of roof shapes is supported. If a terrain is provided, buildings are placed on the terrain automatically.
  • blender-osm downloads and imports real world terrain data with resolution about 30 meter.
  • River, lakes, forests, vegetation are imported as polygons. If a terrain is provided, they are projected on the terrain.
  • Imported roads, paths and railways have width. They are represented by Blender curves with a profile object. If a terrain is provided, roads are projected on the terrain.

Get the addon at gumroad.com! You might prefer to pay some price for the addon to support its development. However it is completely optional. The addon source code is available under GPL license!

The detailed documentation is available here.

Links and contacts

8 Likes

Seems like a much need and great add on. I will reserve judgment until I install it and see how this and the other addon you uploaded works. Just to let you know this has been tried before. About 3 years ago a user here tried to upload an addon that did the same thing. I somewhat got it to work but when I pointed out that he needed to answer questions about the operation he got upset and left the forum.

Well thank you and great job. Really works although face normals are irregular from building to building.

What do you mean? Can you show a screenshot?

Face normals.

Attachments


I think I know the reason for that behavior. Points in some polygons in the OpenStreetMap are ordered clockwise, in the other polygons the points are ordered counterclockwise. As the consequence normals for the resulting Blender flat objects are pointing either upwards or downwards.

I’ll try to fix that.

Thats really not the problem, just select all and recalculate normals (Ctrl+N), you can do that in your script. Does OpenStreetMaps have height of the buildings ?

Some buildings do have height tag. Many buildings have number of storeys tag. There is even Simple 3D Buildings specification in OpenStreetMap which specifies how to tag some 3D attributes of a building. The Simple 3D Buildings specification page contains links to interactive demos where some cities can be explored with a 3D viewer.

I import all building tags as custom Blender object properties.

I consider OpenStreetMap import addon as auxiliary tool for further modelling. Personally I use imported flat building outlines to georeference a Blender scene with the OpenStreetMap Georeferencing addon. Also, the imported OpenStreetMap building outlines can be used to set correct scaling for a model with the Target Scaling addon.

So I don’t have plans to support tags from the Simple 3D Buildings specification

The short answer. I don’t see any convergence point. I think that’s quite normal. The author of the old OSM addon used different design principles.

Now the longer answer.

I import each OSM object as a separate Blender object with all OSM tags. I use OSM tags name or address to name the corresponding Blender object. This enables search by name or address in Blender. The old addon imports all OSM objects as a single Blender object.

I use the transverse Mercator projection with the central meridian coming through the center of the imported area. The projection choice is explained by the negligible size distortion in the vicinity of the central meridian. The old addon uses the UTM projection which divides the earth surface into 60 fixed zones. The size distortion could be quite noticeable near the UTM zone border.

Finally, I separated OSM parser from application logic. My OSM parser can used in any application, i.e. not only in Blender. As the consequence, my addon can be easily extended to add support for additional OSM tags.

Just tried to see compatibility, it doesn’t work obviously. I’ll try to speak with domlysz.
A remark, all objects are with center at 0,0,0 and the actual vertices of the mesh are then many thousands kilometers away from origin. It may greatly reduce the precision. Would it be possible to center the first import on the origin to have full precision ? Blender is not as precise as Autocad. I couldn’t get any official numbers, but it’s most certainly a 32bit float. Precise near origin and loosing precision exponentially far away from it.

My primary use case is neighborhood (city, town) modelling. The area extent has order of magnitude of kilometers or dozens of kilometers.
OpenStretMap and SRTM terrain import doesn’t have sense on a large country or a continent scale.

Here is how my import addons calculate the location of the imported area in the Blender global coordinate system:

If the active scene does not have custom properties latitude and longitude or if Ignore existing georeferencing checkbox is checked, custom properties latitude and longitude are set for the active scene. They correspond to the center of the imported OSM area.

If the active scene does have custom properties latitude and longitude and Ignore existing georeferencing checkbox is unchecked, the custom properties latitude and longitude are used as the center for the import. In other words, the newly imported OSM objects will be placed correctly with respect to previously imported OSM objects.

Maybe a bug then. In my case, on the default scene, when importing OSM with your addon (a part of Karlsruhe in Germany), the empty is on 0,0,0 but the plan of Karlsruhe is at 6Km on x and 6Km on y. Or I don’t understand the meaning of OSM center. I thought it was the center of the exported area. (I export the area viewed in browser from openstreetmap.org)

Am I missing something. I tried the addon on an .osm file of a small 4 block area in my city and all I got was and empty. No buildings or streets at all.

Could you send me your .osm files?

As said in my post, your actual plan is somewhere else. You have to expand the empty in outliner to see the children, select one of them and in the 3D view hit . to center the view on your selection. In my case, my plan was 6Km away from empty.

@vvoovv Is this offset due to the precision limitation of the long/lat scene parameters ?

I didn’t see your .osm files, so here is my guess.
I think the reason for that behavior is that your .osm files contains long roads.
Roads aren’t imported but they are taken into account when the extent (bounding box) is calculated.

If the active Blender scene doesn’t have custom properties latitude and longitude, then the center of the imported OSM extent is used as the projection center. The projection center must be known before the first OSM object is added to the Blender active scene.

You can use JOSM OpenStreetMap editor to cut unnecessary stuff off and save the resulting .osm file to your local disk. But don’t send your edits back to the OSM global database!

You guess was good, very long road indeed :smiley:
For the distances, their is no way to have OSM correctly scaled without manual tuning ?

Your addon is really good, thanks a lot for your help :slight_smile:

I just emailed you the .osm file. As far as these “custom properties” are concerned. Are these things we should set up in blender before we import the osm file. If so you need to document that well on the documentation pages you set up. As I read the pages they looked like items that were imported when you imported the .osm file.

OK next question. How does one do this?

Custom properties are made by script on import. for JOSM, you can’t await from someone with a job, maybe family, giving you an addon fo free that he will learn you a program he didn’t do. Go on josm website and look the doc there.