Over the past 3 months I have been working on OSM2World for Google Summer of Code. The aim of my project was to add support for indoor tagging, meaning rendering indoor data in 3D. This includes basic features such as rooms and corridors, windows and doors as well as objects that may span levels such as stairs and barriers.
The code that I have produced can be seen in these 3 pull requests:
And the results of my work are as follows.
Basic Indoor Features
The first objects to be mapped indoors are usually areas (defining a floor), corridors (defining a floor and ceiling), rooms (defining a floor, ceiling and walls) and walls. The tagging for which should follow simple indoor tagging schema (https://wiki.openstreetmap.org/wiki/Simple_Indoor_Tagging). These can be of any shape, can span multiple levels and have different heights defined by areas with the indoor=level tag. This was the first task to be approached.
To improve the look of the walls a lot of time was spent giving them thickness. This came with many challenges such as having to find where each wall intersects adjacent walls and having to move walls to be fully inside buildings to name just a few.
Walls and floors will often be made of different materials and this data can be tagged using the “material=” tag for walls and “surface=” tag for floors. To give rooms different textured walls, wall ways can be drawn over segments of a room and given a material tag.
It is also possible for there to be indoor data within a building roof. Without taking the roof shape into account this can cause problems with walls poking out of the building. After some thought and discussion a solution allowing walls to conform to the shape of the roof was thought of, however shaping the ceiling to the roof ended up being somewhat harder and so this has not been done.
This is an image of a room within a pyramidal roof, the roof has not been rendered for ease of viewing.
Config options were added for better viewing of indoor data, these also allow a user to export specific parts of the rendering if they wish. The options added are
noOuterWalls = true (default false, prevents building walls from being rendered leaving indoor walls) noRoofs = true (default false, prevents building roofs from being rendered) renderLevels = 0,1,2 (only allows the specified levels to be rendered) notRenderLevels = 1,2 (hides the specified levels, takes presedence over renderLevels)
Windows and Doors
The next most common feature to map is often indoor doors. Windows can also be mapped using the proposed window tagging schema here (https://wiki.openstreetmap.org/wiki/User:Tordanik/Window_tagging). Windows and doors can already be rendered in outdoor walls so this was a case of placing the same objects in indoor walls.
It is also nice to have windows that can be seen through. Mapped windows between the outside and an indoor element, as well as between 2 indoor elements use the GLASS_ TRANSPARENT texture which can be defined in the config file, this produces the following effect:
Attaching Currently Supported Objects
There are currently many objects that are rendered by OSM2World thhttps://imgur.com/rGV2IC1at can also be found indoors so it would be useful to render these on the correct level within a building. The main bulk of this code was written by my mentor but I went about attaching specific objects. Benches, stairs and many types of barriers can all be rendered within buildings and the latter 2 can span multiple levels.
Area objects such as tennis courts, football pitches and helipads can also be placed on flat roofs as well as indoors if given the correct tags.
Finally, elevators can be rendered. The solution to this also provides the architecture to easily add models of other indoor objects in the future through the IndoorModule.
A more detailed account of my progress can be found in this forum thread (https://forum.openstreetmap.org/viewtopic.php?id=69579), along with more specifics regarding object tagging and the problems that I faced when implementing this.
What Didn’t Get Done?
I had planned to cut holes in the outer walls for adjacent building parts to prevent outer walls from being rendering inside of a building. This is quite a complicated issue which I unfortunatley did not have time to implement. Ideas of how this could be done have been thought of however.
More commonly mapped indoor objects have also not been rendered, but the architecture to add them has been added as mentioned before.
I have certainly learned a lot over the past few months. More technical aspects such as how to use git more properly and how to better use some functionality provided by Java, but I have also learned a lot about OSM as an organisation and a community. I will definitely be mapping some areas around my university in the future.
Finally, I would like to thank my mentor Tordanik for all of his help and for being so responsive to the many questions I had.