luukvdmeer / sfnetworks

Tidy Geospatial Networks in R
https://luukvdmeer.github.io/sfnetworks/
Other
345 stars 20 forks source link

Modify `to_spatial_contracted` test and code. Fix #243 #248

Open MattArran opened 1 year ago

MattArran commented 1 year ago
  1. Update test_morphers.m, specifying clusters for to_spatial_contracted() so as to catch the issue with mismatching node geometry (Ref. #243)
  2. Modify to_spatial_contracted() in morphers.m to ensure that the order of the updated node geometries matches the order of the updated nodes, even if there are non-duplicated, non-sorted clustering values.

Pull request to main branch because develop branch missing.

agila5 commented 1 year ago

Hi @MattArran and thank you very much for your PR! Unfortunately, I'm not really familiar with the code behind to_spatial_contracted since it was written by Luuk or Lorena, so I think you have to wait for their review. Thanks again!

MattArran commented 1 year ago

Hi Andrea! No problem; it's a small fix and, as #243 mentions, the problem can be avoided in the interrim by sorting the tibble of nodes by the clustering variable before applying to_spatial_contract. Glad to make even a tiny contribution to such a useful package!