Skip to content
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

st_length #30

Open
CheFusi opened this issue Feb 21, 2023 · 0 comments
Open

st_length #30

CheFusi opened this issue Feb 21, 2023 · 0 comments

Comments

@CheFusi
Copy link

CheFusi commented Feb 21, 2023

There may be an error with the 'meters' column of bike boulevard.

{r}
bart_lines$len_mi <- units::set_units(st_length(bart_lines), mi)
bart_lines$len_km <- units::set_units(st_length(bart_lines), km)
bart_lines$len_m <- units::set_units(st_length(bart_lines), m)

bart_lines$len_m <- units::set_units(st_length(bart_lines), m)

head(bart_lines)

When you calculate the lengths by transforming to various CRS'

bart_lines$len_NAD83 <- units::set_units(st_length(st_transform(bart_lines,26910)), m)
bart_lines$len_WebMarc <- units::set_units(st_length(st_transform(bart_lines,3857)), m)
bart_lines$len_WGS84 <- units::set_units(st_length(st_transform(bart_lines,4326)), m)

you see that Web Marc outputs the closest length to the 'meters' column. The transformation to WGS84 is redundant and was done just to verify how the st_length function is working. So in theory both these outputs should be the same as the 'meters' column.

Caused some confusion during the workshop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant