Open Charlesfox1 opened 4 years ago
nice! Funny, I was looking into the same thing very recently when I noticed that @rbanick was trying to snap over 100k points to his dense road network and pandana_snap took a long time.
I was working on a new function called pandana_snap_c on the import_shapefile branch: https://github.com/worldbank/GOSTnets/blob/import_shapefile/GOSTnets/core.py#L1743
maybe you can check it out @Charlesfox1?
Originally I thought the KD tree was the slow part, so I used the C version in SciPy. Then after timing it I found out that the re-projection was the issue; and also found out that doing it in Pandas is faster : )
Also, I believe there is no need to re-project at all if the source and target projections are the same, so we can save some time there.
I can confirm that pandana_snap is by far the slowest part of my GOSTNetting process! Performance improvements would be most welcome :-)
Ok boys
gn.pandana_snap() is still too slow. the .apply call is totally unnecessary - use geospandas to reproject, it's MUCH faster. updated function suggestion below: