Skip to content

Commit

Permalink
Merge branch 'GispoCoding-dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
smmaurer committed Aug 23, 2022
2 parents 1e3920f + e5443e1 commit 7529473
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions pandana/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,9 +696,8 @@ def init_pois(self, num_categories, max_dist, max_pois):
)
return None

def set_pois(
self, category=None, maxdist=None, maxitems=None, x_col=None, y_col=None
):
def set_pois(self, category=None, maxdist=None, maxitems=None, x_col=None, y_col=None,
mapping_distance=None):
"""
Set the location of all the points of interest (POIs) of this category.
The POIs are connected to the closest node in the Pandana network
Expand All @@ -719,6 +718,13 @@ def set_pois(
The x location (longitude) of POIs in this category
y_col : pandas.Series (float)
The y location (latitude) of POIs in this category
mapping_distance : float, optional
The maximum distance that will be considered a match between the
POIs and the nearest node in the network. This will usually
be a distance unit in meters however if you have customized the
impedance this could be in other units such as utility or time
etc. If not specified, every POI will be mapped to
the nearest node.
Returns
-------
Expand Down Expand Up @@ -748,7 +754,7 @@ def set_pois(

self.max_pois = maxitems

node_ids = self.get_node_ids(x_col, y_col)
node_ids = self.get_node_ids(x_col, y_col, mapping_distance=mapping_distance)

self.poi_category_indexes[category] = node_ids.index

Expand Down

0 comments on commit 7529473

Please sign in to comment.