Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Latest commit

 

History

History
126 lines (76 loc) · 4.91 KB

map-creation.md

File metadata and controls

126 lines (76 loc) · 4.91 KB

Indoor Map Creation

Tools

Terminology

  • Nodes poi
  • Ways polygons
  • OSM
  • JOSM

Tags

Ways and nodes have to be annotated with specific tags to be picked up as part of the indoor map

indoor tag

The indoor tag is used by most ways and nodes related to indoor nodes

Frequently used values are

Values Description
room Describes an ordinary room
corridor Specific type of a room, no technical consequences
beacon BLE-Beacon, should be used in conjunction with a id-tag, that provides the MAC-Address.
path Usual walkway through a room. Used for better display of way, when navigating. Use with pathfor

level tag

Needed to assign a node or way to a level of the building. Should be a number. A single node or way can be assigned to multiple levels at once separating each level with a semicolon, e.g. 1;2;3;4, for identical rooms on multiple levels. Caution, as a room can only have one ref/name so uniquely identifying a room can be troublesome.

Elevators and staircases have to make use of declaring multiple levels to be eligible for creating paths between levels (or use the repeat-on tag)

repeat-on tag

Can be used instead of listing multiple levels in the level tag. Same syntax rules apply for declaring multiple levels.

id tag

MAC-Address for a BLE-Beacon e.g. ab:cd:ef:12:23

name and ref tag

Naming a room, label is generated from this tag. Is also used to reference with pathfor. Is also used for searching a room.

door and entrance tag

Doors and entrances are represented as a POI e.g. a single node. The rooms the door is connecting have to also have a node at exactly the same position as the door, to be automatically pick up the door as part of the rooms.

more tags

tag description
pathfor Binds a indoor-path to a room

tag-mapping xml

The mapwriter only writes tags with known key/values to the map. These tags have to be defined in the tag-mapping.xml.

Elements

Doors and entrances

Doors and entrances are only supported as a single node. The node has to be part of the room's way, the door is part of.

Elevators and Stairs

A single elevator or stairs element needs to be defined on multiple levels with the level or repeat-on tag for the navigation to pick it up. Elevators and stairs need to have a door to mark the direction and room they are leading into.

Background map

For the surrounding area a publicy available OSM map extract can be used and is recommended. OSM-Wiki

Combining maps

Prepare indoor map

The XML generated by JOSM is incomplete, as the nodes and ways created by JOSM are missing the timestamp and version attribute. They content is meaningless for us, but the fields are required by Osmosis XML-reader. To comply with the reader we can add the necessary attributes and fill them with dummy values.

    timestamp='2010-03-16T11:47:08Z' version='5'
    
    e.g.
    <node id='-137712' timestamp='2010-03-16T11:47:08Z' visible='true' version='1' lat='48.17674918525' lon='11.53427609559' />
    <way id='-103635' timestamp='2010-03-16T11:47:08Z' visible='true' version='1'>

Prepare tag-mapping.xml

The mapsforge writer only writes known tags to the file. All tag names and sometimes tag name/value-pairs have to be listed in the tag-mapping.xml

The mapsforge writer is kinda buggy, sometimes you can use '%s' and '%s' to cover all values for a tag. Sometimes you have to explicitly mention all possible/used values e.g. <osm-tag key="level" value="%s" /> has to be <osm-tag key="level" value="1;2;3" />

Merge maps

Finally we can merge our indoor map with a map of the environment using Osmosis and create our .map file

/path/to/osmosis --rb file=<background map> --rx file=<indoor-map> --s --m --mw file=<target-file> bbox=<BOTTOM>,<LEFT>,<TOP>,<RIGHT> tag-values=true tag-conf-file=<tag-mapping.xml> 

Additional information

Troubleshooting

org.openstreetmap.osmosis.core.OsmosisRuntimeException: Task type mw doesn't exist.

The mapsforge-writer is not properly installed.

Created map misses certain tags/elements

The tag-mapping.xml was not provided when the .map was created or is missing the specific tags/values.