Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Provide option to draw graticule, or fail gracefully? #2084

Open
cpsievert opened this Issue Mar 24, 2017 · 1 comment

Comments

Projects

TODO in hadley

3 participants
Contributor

cpsievert commented Mar 24, 2017

There are projections where plot() still produces (an arguably wrong) result when a st_graticule() fails. Would it make sense to replicate that behavior of failing "gracefully"? Or maybe even something like coord_sf(graticule = FALSE) since it might also help out with #2071?

library(sf)
library(mapdata)
w <- st_as_sf(maps::map("world", plot = FALSE, fill = TRUE))
wt <- st_transform(w, "+proj=aea +lat_1=55 +lat_2=65 +lat_0=50 +lon_0=-154 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
plot(wt)

screen shot 2017-03-24 at 6 58 08 pm

 st_graticule(wt)
#> Error code: 6
#> Error in CPL_transform(x, crs$proj4string, crs$epsg) : OGR error
ggplot() + geom_sf(data=wt)
#> Error code: 6
#> Error in CPL_transform(x, crs$proj4string, crs$epsg) : OGR error

hadley added to TODO in hadley Jun 1, 2017

karawoo added the feature label Jun 12, 2017

Contributor

edzer commented Jun 28, 2017

This now works with sf devel (and probably also 0.5-1):

x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment