Closed xiaochi-liu closed 5 months ago
Thanks for reporting this. Could you retry with the latest verison 0.0.6 of basemaps
from CRAN? This seems to have orginated from an upstream bug, should be fixed now.
I have the dev version from github and also have this issue (and the resolution makes it not useable, too, when other layers like world_light_gray_base do work):
bbox <- structure(list(x = structure(list(structure(list(structure(c(19616242.6270123,
19703033.9940241, 19703033.9940241, 19616242.6270123, 19616242.6270123,
-4871287.16788705, -4871287.16788705, -4802367.16946593, -4802367.16946593,
-4871287.16788705), dim = c(5L, 2L))), class = c("XY", "POLYGON",
"sfg"))), class = c("sfc_POLYGON", "sfc"), precision = 0, bbox = structure(c(xmin = 19616242.6270123,
ymin = -4871287.16788705, xmax = 19703033.9940241, ymax = -4802367.16946593
), class = "bbox"), crs = structure(list(input = "EPSG:3857",
wkt = "PROJCRS[\"WGS 84 / Pseudo-Mercator\",\n BASEGEOGCRS[\"WGS 84\",\n ENSEMBLE[\"World Geodetic System 1984 ensemble\",\n MEMBER[\"World Geodetic System 1984 (Transit)\"],\n MEMBER[\"World Geodetic System 1984 (G730)\"],\n MEMBER[\"World Geodetic System 1984 (G873)\"],\n MEMBER[\"World Geodetic System 1984 (G1150)\"],\n MEMBER[\"World Geodetic System 1984 (G1674)\"],\n MEMBER[\"World Geodetic System 1984 (G1762)\"],\n MEMBER[\"World Geodetic System 1984 (G2139)\"],\n ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n LENGTHUNIT[\"metre\",1]],\n ENSEMBLEACCURACY[2.0]],\n PRIMEM[\"Greenwich\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433]],\n ID[\"EPSG\",4326]],\n CONVERSION[\"Popular Visualisation Pseudo-Mercator\",\n METHOD[\"Popular Visualisation Pseudo Mercator\",\n ID[\"EPSG\",1024]],\n PARAMETER[\"Latitude of natural origin\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8801]],\n PARAMETER[\"Longitude of natural origin\",0,\n ANGLEUNIT[\"degree\",0.0174532925199433],\n ID[\"EPSG\",8802]],\n PARAMETER[\"False easting\",0,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8806]],\n PARAMETER[\"False northing\",0,\n LENGTHUNIT[\"metre\",1],\n ID[\"EPSG\",8807]]],\n CS[Cartesian,2],\n AXIS[\"easting (X)\",east,\n ORDER[1],\n LENGTHUNIT[\"metre\",1]],\n AXIS[\"northing (Y)\",north,\n ORDER[2],\n LENGTHUNIT[\"metre\",1]],\n USAGE[\n SCOPE[\"Web mapping and visualisation.\"],\n AREA[\"World between 85.06°S and 85.06°N.\"],\n BBOX[-85.06,-180,85.06,180]],\n ID[\"EPSG\",3857]]"), class = "crs"), n_empty = 0L)), row.names = 1L, class = c("sf",
"data.frame"), sf_column = "x", agr = structure(integer(0), class = "factor", levels = c("constant",
"aggregate", "identity"), names = character(0)))
set_defaults(map_service = "esri", map_type = "world_light_gray_reference")
ggplot() +
basemap_gglayer(bbox) +
scale_fill_identity() +
coord_sf()
thank you!
Thanks for reporting. I included a patch with version 0.0.7
. This should fix
ggplot
warnings "Raster pixels are placed at uneven horizontal intervals and will be shifted", as basemaps
now correctly selects whether to use geom_tile
and geom_raster
for building the plotmaxpixels
was set to 50000 by default (see ?gg_raster
for details) causing the resolution of ggplot
rendered maps to be always less high then for other output classes. To adjust resolution of ggplot
basemaps, you can always supply the maxpixels
argument to basemap_gglayer()
and basemap_ggplot
(). The manual has been updated to reflect that.The visual tiling issues shown in @xiaochi-liu's initial post were resolved with version 0.0.6
, thus I was unable to reproduce them again with your regex.
Please reinstall the package using
remotes::install_github("16eagle/basemaps", dependencies = T)
before retrying your example. Please let me know if this resolves the issue.
Please reopen if this issue persists with the latest CRAN
release of basemaps
-
Thanks for this excellent package. I'd like to download a basemap for Victoria, Australia:
However, I encountered the following warning and couldn't receive the right outcome:
May I ask how I should handle this situation? The test data is available here, and my session info is as follows:
Your kind guidance is much appreciated!