Creating centerlines from polygons
For any routing algorithm to work, we need a set of network LineStrings to perform our shortest path query on. Here, you, of course, have some options, ones that you can download to the OSM data to clean up the roads. Secondly, you could digitize your own set of network lines or, thirdly, you can try to autogenerate these lines.
The generation of this network LineString is of utmost importance and determines the quality and types of routes that we can generate. In an indoor environment, we have no roads and street names; instead, we have hallways, rooms, lounges, elevators, ramps, and stairs. These features are our roads, bridges, and highway metaphors where we want to create routes for people to walk.
How we can create basic network LineStrings from polygons that represent hallways is what we are going to show you in this recipe.
Getting ready
This exercise requires us to have a plan of some sort in digital form with polygons representing hallways and other...