Closed Theodore-Chatziioannou closed 1 month ago
thanks @brynpickering - I have made some updates in response to your comments. Before merging, @gac55 let me know if it works for your use case.
Thanks @Theodore-Chatziioannou , picking this up now
Hi @Theodore-Chatziioannou,
I've tested the new pam snap-facilities
function with 100 agents' plan for Londinium, and it worked quite well!
When I tried it on TE pop, I noticed it perform quite slow when scaling up to larger populations. It took about 30 minutes of runtime for 0.01% of the population for TE pop.
I feel the primary slowdown seems to come from the way distances are calculated for each activity to all network links. Maybe some vectorized operations or something similar would help to potential speed-ups to process?
thanks @syhwawa
activity_points
and activities_info
. The updated locations can be queried and assigned directly in the first loop.Thanks for the comments @Theodore-Chatziioannou
The function has been updated to remove the separate loops for collecting and applying data. Now, the updated locations are queried and assigned directly within the first loop. And the lint error has been fixed.
Adds CLI method for snapping activity facilities to a network geometry.
It can be invoked as:
pam snap-facilities <path_population_in> <path_population_out> <path_network_geometry> -f <link_id_field>
For each activity, the method will identify the closest link in the shapefile, and add it as a
link=..
attribute to the activity element. Finally, the updated plans file will be saved to a new xml file.Checklist
Any checks which are not relevant to the PR can be pre-checked by the PR creator. All others should be checked by the reviewer(s). You can add extra checklist items here if required by the PR.