Tag configuration
The six CSV files in parameters/ decide which OSM features become barriers. MapData._load_tag_configs() reads them at construction into the instance attributes BARRIER_TAGS, NOT_BARRIER_TAGS, ANTI_BARRIER_TAGS, OBSTACLE_TAGS, NOT_OBSTACLE_TAGS and ANTI_OBSTACLE_TAGS.
| Feature | Include | Wildcard exceptions | Override |
|---|---|---|---|
| Ways and multipolygon relations | barrier_tags.csv |
not_barrier_tags.csv |
anti_barrier_tags.csv |
| Standalone nodes | obstacle_tags.csv |
not_obstacle_tags.csv |
anti_obstacle_tags.csv |
CSV format
Two columns, no header:
key: OSM tag key (barrier,natural,man_made).value: OSM tag value, or*for any value of that key.
Rows with the same key merge into {key: [value1, value2, ...]}.
Precedence
Way.is_barrier(yes_tags, not_tags, anti_tags) in map_data/utils/way.py decides both cases:
- Override. A feature with any tag listed in the
anti_*file is never a barrier. - Exact match. A tag whose exact
key,valueis in the include file makes the feature a barrier. Thenot_*file has no effect on exact matches. - Wildcard match. A tag whose key has
*in the include file makes the feature a barrier, unless thatkey,valueis in thenot_*file.
So not_* only carves exceptions out of wildcard rules: man_made,* plus man_made,bridge in not_barrier_tags.csv keeps bridges traversable. To suppress an exact match, remove it from the include file or add it to the anti_* file.
Each tag is checked independently: a feature with one excepted tag and another matching tag is still a barrier.
Barrier ways
separate_ways in map_data/utils/parsing.py sorts every parsed way:
- any
highwayvalue inFOOTWAY_VALUES→ footway, buffered tobuffer_widths.footway(default 3 m full width); - any other
highwayvalue → road, buffered tobuffer_widths.road(default 7 m); - otherwise, if
is_barrierwith the barrier tables → barrier. Closed ways and multipolygons stay polygons; open lines are buffered tobuffer_widths.barrier(default 2 m).
The highway check runs first, so a way tagged both highway=* and barrier=* is a road or footway.
anti_barrier_tags.csv holds location,underground, location,underwater and location,overhead: tunnels and overhead lines that share keys with surface barriers.
Obstacle nodes
parse_osm_nodes checks nodes that are not part of any parsed way. A node that passes is_barrier with the obstacle tables becomes a circle of radius obstacle_radius (default 2 m) and is added to barriers_list.
anti_obstacle_tags.csv holds passable openings in walls (barrier,entrance, barrier,coupure, barrier,sally_port, historic,city_gate).
Buffer widths and the obstacle radius come from config/planner_defaults.yaml; see Planner configuration.
Common edits
Make a specific value a barrier:
- Add
key,valuetobarrier_tags.csv(ways) orobstacle_tags.csv(nodes). - If the key already has a
*rule, make sure the value is not in the matchingnot_*file.
Make a feature passable:
- covered by a wildcard rule: add
key,valueto thenot_*file; - an exact match, or a tag that should cancel every other match (
location,underground): add it to theanti_*file.
Tag tables are read when MapData is constructed. After editing a CSV, regenerate the .mapdata file with create_mapdata or the viewer's GPX upload; existing .mapdata files keep their old classification.