Blender-osm: OpenStreetMap and terrain for Blender

add-ons

(vvoovv) #41

SHABA1:

I tried the addon with the file you sent me via e-mail a week ago. The roads were imported if the Import roads and paths checkbox was checked. You can check OSM tags in the custom properties of the selected object. Buildings from your OSM file doesn’t contain any height information. However I ignore height information even if it is provided, since I consider the addon as auxiliary tool for further modelling. You can use Thickness import setting to get all imported OSM buildings extruded.


(SHABA1) #42

First let me thank you for the quick response. Can you post a screenshot of the imported file that I emailed you with the roads included. I just tried importing again with that same file and I see nothing other then the cubes for the buildings. Maybe I am missing something.


(SHABA1) #43

Nevermind. I went back again and ENSURED I had the import road checkbox checked. I saw the roads as single edges now and just had to select on and go into the edit mode and select all verts extrude and press F key to add faces. Thanks for the great addon I look forward to your updates.


(vvoovv) #44

SHABA1:
I sent the screenshot via e-mail.


(vvoovv) #45

Ok, good that you’ve managed it.


(matali) #46

Hi vvoovv,
Thanks for the update. I just tested it, works well. This are only the midlepoints of the road if I’m correct? Do you know any good solution to have “real streets” out of those lines? Maperitive can export svg with correct street width that can then be imported in Blender as triangulated mesh. Maybe JOSM has the same and the code could be portable to python? Your work is already really nice, it’s just in case you would have time and will to do it.
Regards


(vvoovv) #47

matali:
Yes, I’d like to have real roads and paths that have some width. Also. I’d like to place them on terrain. I’d like to implement those features in a separate addon. Right now I’m searching for information what was already done on that topic. If you have any idea, let me know.


(matali) #48

http://jerome.le.chat.free.fr/index.php/en/city-engine/documentation/introduction.html

Littleneo did a pretty amazing addon for 2.49, never got it to work on 2.6x sadly, but it generates 3D roads with buildings, lights and furniture


(enzyme69) #49

I did a test on the Add-On and osm around the area where I live in Austraila. It works! I also tried NYC, it has more details.

Do you think the import can also have building “height” option?

If not, I should try Sverchok for height. A matter of figuring out to get height from each building ID and applied it. Can be a post-Python script after the import though.


(vvoovv) #50

The addon has thickness import options that applies the same height to all buildings.

I’d like to create real buildings from OpenStreetMap building outlines with “CGA shape grammar” framework but the development will take some time.

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.


(enzyme69) #51

@vvoovv
It has Thickness options? Ok, I will check it out. Random extrusions should be pretty nice for now actually. Will use Sverchok for that :slight_smile:

Ok, I will investigate the Height tag, storeys, and “simple 3D building” specs.

I was impressed by the CGA Shape Grammar. It’s new to me.


(anarubbet) #52

Hi!

I’m working on a project at University and I would like to use your script io_import_scene_osm.py in another script that I am creating. I want to use it without opening Blender, and I need to know what function can I use to open the OSM file and generate the city. Could you help me?

My idea is run blender in background, something like this:

$ blender -b -P myScript.py --/Docs/osmFile.osm

and generate the buildings with height.

Sorry for my bad english and thanks in advance!
Ana.


(anarubbet) #53

Hi!

I’m working on a project at University and I would like to use your script io_import_scene_osm.py in another script that I am creating. I want to use it without opening Blender, and I need to know what function can I use to open the OSM file and generate the city. Could you help me?

My idea is run blender in background, something like this:

$ blender -b -P myScript.py --/Docs/osmFile.osm

and generate the buildings with height.

Sorry for my bad english and thanks in advance!
Ana.


(vvoovv) #54

@anarubbet

You can import OSM file from your script in the following way:


bpy.ops.import_scene.osm(filepath="path/to/osm/file", thickness=10)

If you are on Window “path/to/osm/file” might look like “D:/path/to/your-file.osm”.

Note the parameter thickness. If it isn’t equal to zero, then you’ll get extruded objects instead of flat ones with the specified thickness.

Here are all optional parameters and their default values


bpy.ops.import_scene.osm(filepath="", ignoreGeoreferencing=False, singleMesh=False, importBuildings=True, importHighways=False, thickness=0)


(anarubbet) #55

It works perfectly!

Thank you very much.
Ana.


(anarubbet) #56

Hi again!

I have a new problem. I want to import into the scene an object with a specific coordinates (point where it would be in real world), but I don’t know how to obtain a reference from the openStreetMap import to match this position. Do you know any way?
I have read about this: https://github.com/vvoovv/blender-geo/wiki/Georeferenced-Blender-Scene
but I don’t understand exactly how it works.

Thanks!
Ana.


(vvoovv) #57

I didn’t get what was your task.

Could you describe your use case with more details?


(anarubbet) #58

At first I’d like to know what is this for:


I have read the documentation, but I don’t understand yet. :confused:

Thanks!
Ana.


(vvoovv) #59

It’s about converting between geographic coordinates (latitude and longitude) and Blender coordinates.

The conversion will work only if the geographical coordinates for Zero point in Blender coordinate system were set.
It’s done by setting custom parameter latitude and latitude for the active Blender scene (bpy.context.scene).


(mahlori) #60

hello family can someone help me on how to download “[addon] openstreet osm” i
ll appreciate your response thank you