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

coordinate system mismatch in aoi bounding box #288

Open
evebohnett opened this issue May 8, 2019 · 2 comments
Open

coordinate system mismatch in aoi bounding box #288

evebohnett opened this issue May 8, 2019 · 2 comments

Comments

@evebohnett
Copy link

Lesson 6: Open and Plot Shapefiles in R

In this lesson, there is a emphasis on understanding what the coordinate system is for the data, and looking for the UTM CRS info for the blue bounding box.

Then after the plot renders we can see that the plot is projected in lat long, so there's a mismatch somewhere. Either the ggplot doesn't understand it's in UTM or it's projecting on the fly into lat long. I'm not sure what the intention was here. If this is part of the sf functionality then maybe there can be a line added explaining that.

@jsta
Copy link
Member

jsta commented May 8, 2019

Thanks for the report! I can see what you mean. One option I see would be to show people how to plot the UTM coordinate labels (use the datum flag in coord_sf) but I rarely see this done in practice...

ggplot() + 
  geom_sf(data = aoi_boundary_HARV, size = 3, color = "black", fill = "cyan1") + 
  ggtitle("AOI Boundary Plot") + 
  coord_sf(datum = sf::st_crs(aoi_boundary_HARV))

@ashander
Copy link

Great point about this lesson!

Digging a bit it seems like this is a known issue (tidyverse/ggplot2#2200 (comment)) and the workaround (datum=NULL) is given in the help for sf::st_graticule . It doesn't seem like the docs for ggplot2::coord_sf really reflect this change as of ggplot2_3.2.0

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

3 participants