kadyb / rgugik

Download datasets from Polish Head Office of Geodesy and Cartography
https://kadyb.github.io/rgugik/
Other
33 stars 4 forks source link

Support for sfc objects #34

Closed Nowosad closed 3 years ago

Nowosad commented 4 years ago

Currently, we do something like in the example at https://github.com/kadyb/rgugik/blob/26fac50fb67044196f2ade3bce25b742395c4b68/R/DEM_request.R#L65.

This works well for objects of class sf, but does not support objects of the sfc class. I think, it can be easily fixed with replacing seq_len(nrow(polygon)) with seq_along(sf::st_geometry(polygon)) (maybe some other changes could be also required).

This possible change could make downloading easier for novice users, and we could remove the following line https://github.com/kadyb/rgugik/blob/26fac50fb67044196f2ade3bce25b742395c4b68/vignettes/DEM.Rmd.orig#L95.

kadyb commented 4 years ago

Good idea!