-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utm_zone_lookup not found #144
Comments
Hey @Karine-Pigeon can you provide some info on how you are generating this error? What function are you calling? Also what versions of bcdata and R are you using? The output of sessionInfo() would be ideal. |
Thanks for adding the reprex @Karine-Pigeon. I cannot seem to reproduce the error with library(bcmaps)
#> Loading required package: sf
#> Linking to GEOS 3.11.0, GDAL 3.5.3, PROJ 9.1.0; sf_use_s2() is TRUE
#> Support for Spatial objects (`sp`) was removed in {bcmaps} v2.0.0. Please use `sf` objects with {bcmaps}.
df <- data.frame(
animalid = c("a", "b", "c"),
zone = c(10, 11, 11),
easting = c(500000, 800000, 700000),
northing = c(5000000, 3000000, 1000000)
)
utm_convert(df, easting = "easting", northing = "northing", zone = "zone")
#> Simple feature collection with 3 features and 6 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: 1237767 ymin: -3576605 xmax: 2418043 ymax: 21953.96
#> Projected CRS: NAD83 / BC Albers
#> animalid zone X Y easting northing
#> 10 a 10 1237767 21953.96 5e+05 5e+06
#> 11.2 b 11 2275642 -1807950.91 8e+05 3e+06
#> 11.3 c 11 2418043 -3576604.70 7e+05 1e+06
#> geometry
#> 10 POINT (1237767 21953.96)
#> 11.2 POINT (2275642 -1807951)
#> 11.3 POINT (2418043 -3576605)
─ Packages ───────────────────────────────────────────────────── |
Error in lookup_epsg_code(zone, datum) :
object 'utm_zone_lookup' not found
Fixed by calling the .csv directly using utm_zone_lookup <- read.csv("https://raw.githubusercontent.com/bcgov/bcmaps/main/data-raw/utm-zone-lookup.csv")
R version 4.3.1.
bcmaps version 2.2.0
#test Data with multiple zones, and a column denoting the zone
df <- data.frame(
animalid = c("a", "b", "c"),
zone = c(10, 11, 11),
easting = c(500000, 800000, 700000),
northing = c(5000000, 3000000, 1000000)
)
utm_convert(df, easting = "easting", northing = "northing", zone = "zone")
The text was updated successfully, but these errors were encountered: