paleolimbot / ggspatial

Enhancing spatial visualization in ggplot2
https://paleolimbot.github.io/ggspatial
368 stars 34 forks source link

`rosm::osm.types()` deprecated, but referenced in `annotation_map_tile()` #125

Closed jack-davison closed 3 months ago

jack-davison commented 3 months ago

Hello!

Just a quick query.

To know which types of map tiles are available, the documentation points to [rosm::osm.types()]:

https://github.com/paleolimbot/ggspatial/blob/5c4c903a0785702d83acfe6d9753294882ed676c/R/annotation-map-tile.R#L9

But the documentation for rosm::osm.types() says it is deprecated:

https://github.com/paleolimbot/rosm/blob/d7b3bb9069d94b605c2343c95b57a9d3f7de6904/R/deprecated.R#L202-L206

image

Is there a more up-to-date interface for finding available tilesets? I've tried looking in {rosm} and {ggspatial} but I can't find anything not marked as deprecated!

Cheers, Jack

liamxg commented 3 months ago

Dear @potash and @jack-davison,

please see my print using ggspatial::annotation_map_tile():

Zoom: 6 Fetching 15 missing tiles |===================================================================================| 100% ...complete! Error in ggspatial::annotation_map_tile(): ! Problem while converting geom to grob. ℹ Error occurred in the 1st layer. Caused by error in check.dimensions(): ! Zero tiles were loaded for type stamenwatercolor Run rlang::last_trace() to see where the error occurred.

liamxg commented 3 months ago

what should I do?

paleolimbot commented 3 months ago

Apologies for not responding sooner!

Is there a more up-to-date interface for finding available tilesets?

There isn't! I "deprecated" the old interface to rosm in the process of updating it to remove the rgdal dependency. There is a new interface but it doesn't support a key feature required by ggspatial yet (reprojection) and my time for updating it is very small at the moment (kids!). There is nothing particularly incorrect about the old interface...I mostly just don't want new users to start using it. annotation_map_tile() is a very old user and I am not aware of any problems at the moment.

Zero tiles were loaded for type stamenwatercolor

This is a different error entirely than the one on this thread, but it might mean that this map type no longer works out of the box (i.e., you may need to use a URL pattern instead).

jack-davison commented 3 months ago

Hi @paleolimbot - thanks for the reply - understood!

I am approaching this from an angle of wanting to use {ggspatial} in a package to help create maps, particularly as the alternative ({ggmap}) now has no base map option that does not require an API key. annotation_map_tile() seems to work perfectly fine for me - though do you expect it to change drastically/break in future when you do find time (kids notwithstanding!) to update the {rosm} interface?

paleolimbot commented 3 months ago

do you expect it to change drastically/break in future when you do find time

I think I would probably implement the new version as a different function rather than attempt to modify the arguments of annotation_map_tile(), which has been around in its current form for for many years. I don't anticipate removing annoatation_map_tile() (or the interface on which it depends).

jack-davison commented 3 months ago

Fabulous, thanks very much Dewey!

liamxg commented 3 months ago

why some people use is normal, and some people like me have error?