-
Notifications
You must be signed in to change notification settings - Fork 11
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
Error in png::readPNG(img) : file is not in PNG format #13
Comments
Hello, So I tried this url for the tile server: url <- "https://geodata.nationaalgeoregister.nl/tiles/service/wmts/opentopo/EPSG:28992/{z}/{x}/{y}.jpeg" but remotes::install_github('riatelab/maptiles') library(sf)
#> Linking to GEOS 3.9.0, GDAL 3.2.2, PROJ 7.1.0; sf_use_s2() is TRUE
library(maptiles)
p = st_point(c(328452.9,267552.5))
p = st_sfc(p)
p = st_set_crs(p, 28992)
bb = st_bbox(st_buffer(p, 300000))
url <- "https://geodata.nationaalgeoregister.nl/tiles/service/wmts/opentopo/EPSG:28992/{z}/{x}/{y}.jpeg"
mffp <- list(src="OpenTopo", q=url, sub=NA, cit='')
t <- get_tiles(bb, provider=mffp, crop= T, forceDownload = T, zoom=7)
plot_tiles(t, adjust = TRUE) Created on 2022-02-15 by the reprex package (v2.0.1) I have modified point coordinates and zoom level from your original example to show something not on the sea :-) |
Hi, I came to the same conclusion (concerning the jpeg) yesterday evening! Thanks for acting so promptly. Getting the tiles now works, the only thing I can´t figure out is what is going wrong with the projection. Using the following code
shows that the map is way bigger than it actually should be. |
I suspected something odd with the projection stuff. |
I think you're right. this is the KVP WMTS GetCapabilities page. If you ctrl+f and search for opentopo you can see EPSG:28992. Thanks for your help! |
Additionally, here a working example with an interactive tmap (requires dev-version):
|
Hello,
I am trying to get the following code to work, but it's not working out:
I get the following error:
Error in png::readPNG(img) : file is not in PNG format
The strange this is that entering the following url in my browser does yield the correct tile:
https://geodata.nationaalgeoregister.nl/tiles/service/wmts/opentopo/EPSG:28992/5/16/12.png
So the error that it throws me seems strange.
The text was updated successfully, but these errors were encountered: