-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
geom_sf()
return values of latitude and longitude for data in a projected coordinate system
#2200
Comments
IIRC the labels just come from |
I need to give this a bit more thought on what is the right user interface; this feels a bit like a hack. But right now, ggplot() + geom_sf(data = nc_2163) + coord_sf(datum = st_crs(2163)) I think it is not so bad this takes more effort to get, as, in contrast to long/lat, units of this kinds are pretty much meaningless to most people. Maybe it is easier if |
@edzer if you think this is a reasonable default, and there's already a work around, then I'm happy to leave as is. BTW did you notice that the labels are getting formatted individually instead of collectively? (i.e. 2e+06 vs 1800000) |
I think I'll go for the NULL or FALSE for For the labels I used |
|
using doing |
Oh, you're right! That's super weird: as.character(7:11 * 2e5)
#> [1] "1400000" "1600000" "1800000" "2e+06" "2200000"
format(7:11 * 2e5)
#> [1] "1400000" "1600000" "1800000" "2000000" "2200000" |
the parse loop to digest the degree symbols was the trouble maker. |
* addresses #2119 * tidy graticule fixes * ggplot2 side of issue r-spatial/sf#396 * tabs -> spaces * add ndiscr to docs * fix #2200 * attempt to fix #2060 All cases were in sf.R a geometry column is address with x$geometry, ggplot2 made the wrong assumption that the geometry column has a fixed name. I replaced this in certain instances, where the data are already pretty transformed and no longer have properties of sf objects, with a fixed position, i.e. x[[1]], which seems to work. * fixes r-spatial/sf#438 * address review comments * fix break on geom_raster, objects without list-column see https://gist.github.com/mdsumner/573ec70014df177baa2d1df7e55e1943 for the case that this PR fixes * tidy up * trying @karawoo's suggestion * adds some sf tests * tidy further
geom_sf()
works well in case of data in a geographic coordinate systems - I give graticules and values of latitude and longitude. However, for data in a projected coordinate system, I would expect a plot with values in units of measurement (in this case in meters).I think that as a default it should return graticules and values of latitude and longitude for data in a geographic coordinate systems and values in units of measurement for data in a projected coordinate system. Additionally, there should be an argument to change it.
The text was updated successfully, but these errors were encountered: