nptscot / npt

Data processing code, also use this repo for issue tracking for the Network Planning Tool. See https://nptscot.github.io for development version
https://www.npt.scot/
GNU Affero General Public License v3.0
5 stars 0 forks source link

Replace rbind() with bind_sf() #516

Open Robinlovelace opened 6 days ago

Robinlovelace commented 6 days ago

rbind() is very slow with sf objects: https://github.com/r-spatial/sf/issues/798

We should avoid it on large objects like here:

https://github.com/nptscot/npt/blob/2b9a70f93cf4820429674e31d0f87e4abe890d04/code/build.R#L334

and here

https://github.com/nptscot/npt/blob/2b9a70f93cf4820429674e31d0f87e4abe890d04/code/build.R#L405

We can use bind_sf instead: https://github.com/nptscot/npt/blob/2b9a70f93cf4820429674e31d0f87e4abe890d04/code/build.R#L372