Issue with generating maps in RStudio :

Hi,

I am getting the below exception when attempting to generate a map in “R”. Can anyone advise what this relates to and how I can resolve this?

dublin ← openmap(c(53.36783,-6.318258),c(53.326623,-6.224474),zoom = NULL,‘osm’)

java.lang.NullPointerException
at edu.cens.spatial.RTileController.getTileValues(RTileController.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at RJavaTools.invokeMethod(RJavaTools.java:386)
Error in osmtile(x%%nX, y, zoom, type) :
could not obtain tile: 3952 2654 13

I suspect that the library you are using is broken. Talk to whoever wrote it.

Ask them to check that they’re using valid tile URLs (https not http) and are abiding by https://operations.osmfoundation.org/policies/tiles/ .

First off try the call with one of the other parameters (such as stamen), to see if this is a generic package issue or a map source one.

Second, I had a quick attempt to install the package but it barfed, so cant look further.

Third, people have been posting similar queries about this package for a couple of years.

Fourth, some R packages have been blocked in the past for not following the guidelines.

Fifth, rate limiting or blocking of some URLs for tile access is much more stringent that it has been.

Sixth, the package does not really seem to be maintained: https://github.com/ifellows/ROSM/graphs/contributors

The best place to ask this sort of question is either in issues on the GitHub repo, or possibly in an R forum or GIS StackExchange. The OSM community are relatively unlikely to use R to create maps as there are many other available tools.