mamut_routing_tools.generation.pois¶
Amenity POI extraction from an OSM XML extract.
NoPoiFoundError
¶
Bases: ValueError
The extract holds no amenity of the requested categories.
A ValueError still, so callers that only care that the selection failed
keep working; named so that the hybrid method can tell this apart from a
genuine bad request and fall back to parametric points instead of failing.
is_poi_source_tag
¶
Whether a node's source_tag means it came from an amenity.
Covers poi and poi_manual; parametric tags (param,
param_fill) are not POIs.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/generation/pois.py
poi_ref
¶
A hashable (type, id) identity, or None for an unidentifiable POI.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/generation/pois.py
find_pois
¶
Every element tagged with an amenity in categories, in file order.
Nodes, ways and relations alike: in a real city a large share of the bars, restaurants, schools and car parks are mapped as building outlines rather than points, and reading nodes alone silently loses them.
Source code in MAMUT-routing-tools/src/mamut_routing_tools/generation/pois.py
load_poi_catalog
¶
Every POI of every known category in an extract, parsed at most once.
The whole catalog is read rather than a filtered subset, so switching the category filter never costs another pass over the file. The returned list is shared and must not be mutated by callers.