Closed syounkin closed 2 weeks ago
I'm not getting that error. And when I check the CRS for those two layers (bike_lts_buffer
and routes
) they seem the same:
> st_crs(routes)
Coordinate Reference System:
User input: WGS 84
wkt:
GEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]]
> st_crs(bike_lts_buffer)
Coordinate Reference System:
User input: WGS 84
wkt:
GEOGCRS["WGS 84",
DATUM["World Geodetic System 1984",
ELLIPSOID["WGS 84",6378137,298.257223563,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
CS[ellipsoidal,2],
AXIS["geodetic latitude (Lat)",north,
ORDER[1],
ANGLEUNIT["degree",0.0174532925199433]],
AXIS["geodetic longitude (Lon)",east,
ORDER[2],
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4326]]
> st_crs(routes)==st_crs(bike_lts_buffer)
[1] TRUE
I just made a couple of changes that set the crs explicitly for each data import. Let me know if that fixes the error for you.
Working now. Not sure how it was resolved.
https://github.com/bvarick/route_analysis/blob/338e608d926eef669b21811801b752c803aa642e/cycling_route_analysis_brouter.Rmd#L171