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

It became clear for me, that the addon behavior confused people. I’ll make some changes to make the addon behavior more predictable.
The calculated center of the imported OSM area will be equal to the center of the imported OSM objects.

Still, learning JOSM and contributing to OSM is useful :o

That’s a good solution! Thanks :slight_smile:

Done. Please download the new version of the addon, reinstall it and try it again.

Everything is centred !!! Nice :slight_smile: I also have the impression that the distance are the real one, without having to scale manually. Is that really the case? If yes, well done!

mataly,

Yes the distances are real. That is due to the properties of the transverse Mercator projection with dynamically calculated central meridian. The central meridian comes through the center of the imported area. The size distortion is negligible in the vicinity of the central meridian.

By the way, distances and heights are also real in my SRTM terrain import addon.

I get an error on big files (90Mb from the overpass API at openstreetmap.org):

Traceback (most recent call last):
  File "/home/user/.config/blender/2.70/scripts/addons/io_import_scene_osm.py", line 292, in execute
    self.read_osm_file(context)
  File "/home/user/.config/blender/2.70/scripts/addons/io_import_scene_osm.py", line 308, in read_osm_file
    wayHandlers = [buildings] #[handlers.buildings] #[handlers] #["handlers"]
  File "/home/user/.config/blender/2.70/scripts/addons/io_import_scene_osm.py", line 100, in __init__
    self.prepare()
  File "/home/user/.config/blender/2.70/scripts/addons/io_import_scene_osm.py", line 107, in prepare
    _id = attrs["id"]
KeyError: 'id'

location: <unknown location>:-1

file uploaded here in cas eyou need it : http://speedy.sh/KfrcW/map.osm.7z

Could you reproduce the error on a smaller file and then send me that file?

The problem is not due to the file size.

matali:

I fixed the error. Please download the new version of the addon, reinstall it and try it again.

40607 OSM buildings were imported from your file into 40607 Blender objects. It took at least an hour. The Blender 3D view became totally irresponsive.

The walkaround would be to load the OSM buildings as a single mesh into a single Blender object. I consider OpenStreetMap import addon as auxiliary tool for further modelling. So I don’t think it makes sense to import such big OSM files.

I am going to get the new version with the centering right now. I finally figured out how to get to the part of the imported scene that had buildings in my file. It was not that obvious but with vvoovv’s generous help I deduced it.

Got the new version and centering works perfectly. Congrats. Nice addon.

I’m trying the new version on the 90Mb file. It takes a while but good/strange thing: it uses all 4 cores! First time I see a python addon use 4 cores. Is that intentional? If yes, how did you do that, I thought it was impossible with blender.

matali:
I did nothing special :o

By the way, why do you want to import such a large file? Are you just experimenting or do you have a specific application in mind?

yes it really use all cores, imported in 30 min. But yes it kills viewport perf. Maybe a single mesh with vertexgroups (replacing the custom parameters) would allow that, but I can understand it’s not your goal and maybe we will have good viewport perf after gsoc viewportFX part 3.
By the way disabling “oultine selected” in N panel and closing the outliner improves perf a bit.

Strange, Other addons now work on all cores now too… The only think I changed was to compile Python 3.4 myself to build latest GIT of Blender, but if python could automatically do multithreading, that should be known… don’t know what is happening, have to test more :smiley:

I import such large file because of my projects. But most of the time I just work on a small area and need the rest as background for the video. So I’ll use Campbell addon for the background (one object) and your’s for the area that I really work on.

Added Import as a single mesh option, which makes sense if you are going to import a file with thousands of OpenStreetMap buildings.

Please download the new version of the addon and reinstall it.

Thanks a lot :slight_smile: it works. If I get some time, I’ll try to include the code from Campbell for creating Vertex Groups out of the OSM tags. Anyway, it’s really fast :slight_smile:
Sorry for the delay, I’m a bit overloaded at the moment :frowning:

Added checkbox “Import roads and paths”, so the import of roads and paths is now supported as well.

NICE!!! Heading to the first page to get to the download link right now

Ok I got the latest version. The one that is supposed to import roads. I checked the box that said import the roads and no roads were imported into blender. Just the same buildings that I had before. On another note. When I do import my test .osm I only get some of the buildings in this downtown area. I suppost that is because the contributors have not added other. BUT when they are imported into blender they come in as very flat boxes that are elevated above the default grid. I can select and building and go into edit mode and extrude the top face, but is this what is supposed to happen? Is there not height data in the .osm file for buildings.?