Rendering a 3D-map from an Openstreetmap data can be pretty cumbersome.
But what if the requirements are less demanding than rendering any city of the world in 3D?
What if I just need to render only a certain city limited by particular boundaries? There should not be a lot of polygons to render, especially if I choose to render only those buildings and roads that are actually seen on the screen (I have heard that this technique is used in game development).
I wish to achieve something like this, but it is ok to have just simple boxes for buildings with approximate height and no textures. So, basically I just need an OSM-based road network and simple boxes representing buildings in 3D.
So, the plan could be the following:
Is this plan feasible? Are there any open-source 3D engines that I can use/customize to render an OSM map from an .osm file? Are there any Linux-compatible (OpenGL?) 3D engines exist that can be [possibly] customized to render an OSM map?
Go to openstreetmap.org and zoom to the extent of your area of interest using the search box or the mouse. Click on Export Data in the sidebar on the left to bring up the Export pane. If you are satisfied with the visible extent, click Export. You will be prompted to save map.
To extract the data, you just browse to the OpenStreetMap website and use search, pan, zoom tools like any other web map to find an area where you want the data. Then, use the Export tool on the top bar menu and confirm the bounding box region before export the data. That's it!
OpenStreetMap (OSM) is an open, editable map of the world. For several years, Esri has provided access to OSM data as a basemap.
The process of rendering a map generally means taking raw geospatial data and making a visual map from it. Often the word applies more specifically to the production of a raster image, or a set of raster tiles, but it can refer to the production of map outputs in vector-based formats.
You might want to have a look at OSM2World. It's a converter application that reads OSM data in various file formats and calculates 3D models, taking into account height, roof shape and material attributes of buildings as well as various other details. It can either display the scene with its built-in OpenGL viewer or export the models to formats like .pov or .obj, the latter of which can be read by almost all Open Source modelers and engines.
If the buildings in the area are well-mapped, scenes look like this:
There is also an overview of 3D development activities in the OpenStreetMap community, showcasing several other tools.
Here are a few open-source projects that you can adapt to your needs (see below) most are using opengl which should work fine for your needs as well.
I'd look at glosm first. It's doing most of what you want. You can see some screen shots of it here
Be aware that in most areas OpenStreetMap has only on lots and roads and other stuff, but not individual buildings. That was the case last time I checked, but it depends on the area you're interested in.
As far as I know there's no off-the-box way to do this, but if you just want simple things it should not be that complicated. Brief description:
1 -Extract the footprints polygon data from the osm xml file.
2 -Project into a Cartesian of your choice, for example using PROJ.4, since osm coordinates are in lat-long.
3 -Triangulate to avoid non-convex polygons.
4 -Extrude your triangulated polygon generating a quad for each boundary edge.
5 -Finally, you can insert the generated models into your favorite 3d engine for example OpenSceneGraph or render them by yourself using OpenGL.
After that, the more things you want to add like textures, modeled detail, the more it gets complicated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With