[PLUGIN] OpenStreetMap importer

Hey all – here is a plugin I wrote in my free time to import OpenStreetMap roads and buildings into UE4.

You can export OSM data from OpenStreetMap.org, drag and drop it into Content Browser to save it as an asset. There’s also a very simple Street Map Component that you can use to render cities.

Here is my Tweet about it.

Here is the link to the GitHub source and documentation.

Happy New Year!

–Mike

3 Likes

Happy new year, Mike! Awesome to have a clean OSM integration by an UE4 engine developer. If you see a way to integrate a trending repository like GitHub - reinterpretcat/utymap: Highly customizable library for procedural world generation based on real map data into your approach I am happy to do work on it! He is using heightmap data and has more rules to produce the geometry in an encapsulated C++11 core library.

I did a quick hack to load a mesh from his implementation into Unreal Engine, but keep struggling with a cleaner approach. The is to bind C++ class function to a C API. My efforts are located here:

Hello and happy new year, mike!

nice job there. I am also currently developing nearly the same kind of plugin, like you do. I am doing this for my bachelor thesis and as i saw your post i had to take a deep breath. I hope this doesn´t affect my thesis in any negative way (well i think i should meet with my professor soon :wink: ). I also wanted to publish my plugin by using the marketplace when its ready(near march, i hope our both plugins wont conflict with each other). i haven´t looked into your code yet so i cant tell how far you have gone already or how much more you want to achive, but the scale of the generated world is really, really impressive.

my plugin will also use some heightdata to generate a heightmap and i am deforming the landscape when i spawn roads, houses and rivers procedurally and so on. my focus lies on generating near game-ready levels so that in the near future i have playable procedural generated maps for my game i am working on.

long story short, you did great work there, and i can´t wait to see some more progress :wink:

– Jerome

Happy new year mike!
Thanks for your plugin.

It has been featured on a popular german IT website:
http://www.golem.de/news/hobbyprojekt-unreal-engine-bekommt-openstreetmap-plugin-1701-125330.html

Keep up the good work!

Show it off when you are ready. Your plugin sounds really awesome. :slight_smile:

Greetings, does anyone else have trouble applying materials to the OSM mesh generated by the plugin?

I tried to apply materials to the OSM buildings/roads by drag and drop, but the materials do not show, they just remain grey in color. I have tried all kinds of materials, from the simplest to the complex, they all do not work.

In the picture the roads are GREEN in color, so there must be a way to apply materials to them.

Hope to get some advise.

To get the roads to show up you will need to create a Material that looks like the following.

Reply

I did exactly that, but it still doesn’t work. After applying the material the buildings/roads are still grey(pic attached).

Also i tried multiplying vertex color with a green node, it doesn’t work either.

You will need to apply the Material via the Blueprint Editor by doing the following.

1: Open up the Blueprint (BP).
2: Then go to Details -> Rendering and press the small white triangle to expose the advanced section.
3: Locate the Override Materials option and press the white plus sign to add a new element to the array.
4: Doing this will add a new Material input a that you can then assign your Material to0.
5: Profit.

You should now see the roads and buildings with the correct coloring. Please let me know if you have any other questions or issues.

Cheers-

Sam

Thanks Sam, it works!

2 more questions: Adding the material input would apply material to entire mesh. How do i apply a material only to a certain part of the mesh, for example, just the roads?

Also, there is an orange color hue to the entire mesh when selected, but even when not selected, the orange color hue still persist. Sometimes it disappears and the buildings would look normal again. But most of the time the orange hue stays, i cannot figure out how to turn it on/off.

I do not think that you can because the meshes have no UV Mapping and the color you are seeing is derived from the color stored in the objects vertices. I did not write this so I am only going of what I read in the help file.

As for the orange hue, I am not sure what that could be from. Can you post a screen shot of it so I can see what it looks like?

But looking at the picture on the plugin website:

It seems that roads can be isolated and applied a green material, because only the roads are green in color. The buildings are grey and they seem to have a different material than the roads.

As for the orange hue problem, sometimes when i restart unreal the orange hue is gone, like below:

But most of the time after changing materials or performing other actions, the orange hue remains and just won’t go away, like below:
e34bcdf8712d6bec1d63556156e9af5b6150f79d.jpeg

Are you sure that the green roads in the picture aren’t just NavMesh? I may be completely mistaken but I thought when NavMesh is visible, it is green.

You are right; Nav mesh do show up as green, but it is not a Nav Mesh as this plugin does not have support for Nav Meshes at this time.

The green color for the roads is coming from the vertex color that is stored in the Street Map asset. That is why you have to use the Vertex Color node in your Material. If not then you will not be able to see anything. The same goes for the buildings; they get their color from the color that is stored in the vertices of the building meshes. In case you glossed over it or missed it, the help file tells you what is not supported at this time.

Generated mesh data is currently very simple and lacks collision information, navigation mesh support and has no texture coordinates. This is just designed to serve as an example. For more rendering flexibility and faster performance, the importer could be changed to generate actual Static Mesh assets for map geometry.

At this time you can not issolate the roads like like you want to at this point in time. However using the following Material setup I was able to get the streets of DC to show up green while the buildings show up gray. Try setting your Material up like in the attached image and see if that works for you. As for the orange selection, that looks like it is what happens when you select something inside of a BP. I have not seen that happen on my end, so I do not have a way to fix it at this time. Should I figure something out I will be sure to let you know?

Great job Mike, this seems an awesome plugin!

Although, as a complete noob with this, im slightly lost.

I have got the plugin loaded and can see the StreeMap classes in my content browser, i then imported my osm file.

But i’m not sure what i do next, to actually get the map loaded? Apologies if its really obvious!!

After importing the StreetMap, simply place an Empty Actor in your scene (drag one out from the Modes panel), then click “Add Component” on the right and scroll down to “Street Map”. This will add a Street Map component onto your actor. Now look for the “Street Map” property on the component, then drag and drop your newly-imported asset onto that slot. You should now see your map in the level! If you can’t find it, try double-clicking on your actor in the World Outliner to make the camera jump to the object in the scene. Hope that helps!

–Mike

Ah perfect! Thanks Mike.

When you see that this extension is not in the forum, I wanted to write to inform for you. I have no bad motive. I’m sorry for my bad english. :frowning:

Hey, looks like it’s great stuff !

Wow, this looks mind blowing!