Tag Configuration
The parameters/ directory contains six CSV files that control how OSM tags are mapped to the three semantic categories used internally: barrier, obstacle, and traversable way. Modifying these files lets you tune which real-world features are treated as physical obstacles without changing any Python code.
Overview
OSM features carry arbitrary key=value tag pairs. The classification pipeline reads all tags on a feature and applies three ranked rule sets for each category. The rules are loaded by MapData._load_tag_configs() at construction time and are available as instance attributes (BARRIER_TAGS, NOT_BARRIER_TAGS, etc.).
Barrier classification (ways and polygons)
Barriers are OSM ways (linear or area features) — walls, buildings, water bodies, fences, etc. — that the planner treats as impassable polygons.
barrier_tags.csv — inclusion list
A way is a candidate barrier if any of its tags matches a row in this file.
Representative rows:
The wildcard * in the value column means any value for this key.
not_barrier_tags.csv — exclusion list
If a way matches barrier_tags.csv but also matches a row in not_barrier_tags.csv, it is removed from barrier consideration. This handles cases where a broad wildcard rule would otherwise capture features that are clearly traversable.
Representative rows:
For example, man_made,* in barrier_tags.csv would classify a bridge as a barrier. The man_made,bridge row in not_barrier_tags.csv prevents that.
anti_barrier_tags.csv — override list (highest priority)
If a way matches any row in anti_barrier_tags.csv, it is unconditionally removed from the barrier list, regardless of what barrier_tags.csv or not_barrier_tags.csv say. This is the highest-priority rule.
All rows (the file is short):
These cover tunnels, underwater infrastructure, and overhead cables that share OSM keys with surface barriers but are not physical obstacles at ground level.
Obstacle classification (standalone nodes)
Obstacles are OSM nodes (point features) that are not part of any way — individual bollards, trees, gateposts, information terminals, etc. They are buffered to a 2 m radius circle and appended to barriers_list.
obstacle_tags.csv — inclusion list
A standalone node is a candidate obstacle if any of its tags matches a row in this file.
Representative rows:
not_obstacle_tags.csv — exclusion list
Nodes that match obstacle_tags.csv but also match a row here are excluded.
anti_obstacle_tags.csv — override list
Nodes matching any row here are unconditionally excluded from obstacle classification.
CSV format
Each file uses two columns with no header row:
key— the OSM tag key (e.g.barrier,natural,man_made)value— the OSM tag value, or*to match any value for that key
The files are read with numpy.genfromtxt(..., dtype=str, delimiter=","). Rows with duplicate keys are merged into a list: {key: [value1, value2, ...]}.
Evaluation order
For a given OSM feature, the classification logic in map_data/utils/parsing.py (separate_ways, parse_osm_nodes) applies the three rule sets in the following priority order:
A match in anti_* always wins. A match in not_* overrides a match in *_tags. Only if neither exclusion list matches does the inclusion list apply.
How to add a new barrier type
To classify amenity,playground as a barrier (it is already in barrier_tags.csv as the broad amenity,* rule, but this shows the procedure for a specific value):
- Open
parameters/barrier_tags.csv. - Add a line:
- Ensure
amenity,playgroundis not present innot_barrier_tags.csv. If it is, remove that row. - Re-run
create_mapdata(or callmap_data_instance.run_parse()) to regenerate the classification with the updated rules.
How to make a barrier traversable
To prevent a feature from being classified as a barrier — for example, to allow passage through barrier,gate nodes at ground level — add a row to the appropriate exclusion file:
- Add
barrier,gatetonot_obstacle_tags.csvto exclude gate nodes from obstacle classification. - Add
man_made,bridgetonot_barrier_tags.csv(it is already there) to exclude bridge ways from barrier classification.
After editing any CSV file, re-run create_mapdata or call MapData.run_parse() for the change to take effect. The tag configuration is loaded once at MapData construction and is not re-read during the viewer session.