UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
385 stars 84 forks source link

Allow specifying mapping distance for POIs #170

Closed Rikuoja closed 2 years ago

Rikuoja commented 2 years ago

Description of the bug

Currently, get_node_ids can be called with the optional mapping_distance parameter, but set_pois does not use this parameter at https://github.com/UDST/pandana/blob/dev/pandana/network.py#L680. This results in very far-away POI nodes always being mapped to the closest point in the network.

Mostly this is an issue in cities with waterways or islands. All the POIs on the other side of the waterway or islands will be mapped to closest network point, no matter how far away from the network they are.

Therefore, would be nice to be able to specify mapping_distance when setting POIs, so POIs that are too far will be discarded from the POI set.

Currently, this results in spurious zero distances to lots of POIs at the outermost nodes in e.g. a cape, since all the POIs in any islands will be mapped to this point:

image

Network data (optional)

Any network that has POIs far from network nodes.