Skip to content

Way

Way objects are created by MapData.run_parse(). Geometry is in the UTM zone of the parent MapData; convert a point with utm.to_latlon(x, y, md.zone_number, md.zone_letter).

One map feature (OSM way, merged relation, node obstacle or drawn path).

Attributes:

Name Type Description
id any

OSM id; negative for synthetic ways (merged relation chains, drawn paths), "<id>:<i>" for segments of a split way.

is_area bool

True when line is a polygon, including buffered lines.

nodes list

Ordered node ids (keys of MapData.nodes_cache).

tags dict

OSM tags (key -> string value).

line BaseGeometry or None

Geometry in UTM.

in_out str

Multipolygon member role, "outer", "inner" or "".

is_barrier(yes_tags, not_tags, anti_tags)

Whether a tag matches yes_tags and none matches anti_tags.

Each table maps a tag key to values; "*" in yes_tags matches any value not listed in not_tags.

is_footway()

highway in :data:FOOTWAY_VALUES.

is_road()

Any highway value not in :data:FOOTWAY_VALUES.