Code Monkey home page Code Monkey logo

Comments (12)

brry avatar brry commented on August 17, 2024 1

The maintainer of OpenStreetMap confirmed in private communication that he will adapt his dependencies before the deadline.
For now, I therefore do not plan changes in this package.

from osmscale.

brry avatar brry commented on August 17, 2024 1

Thanks for the update. I have emailed Ian once more. If he doesn't change it in time, I will implement one of the options below.

# data ----

d <- read.table(sep=",", header=TRUE, text=
"lat, long
52.514464, 13.350137
52.370000, 13.120000
55.685143, 12.580008
50.106452, 14.419989
48.847003, 2.3372130
51.505364,-0.1647520")
d <- d[,2:1]
plot(d, asp=1.5, las=1, col="red")
rdwd::addBorders()
d <- d[1:2,] # close up


# OpenStreetMap ----
# nice map, scalebar, projection, uses rJava (OK) - uses rgdal (taken off CRAN soon) !!
dmap <- OSMscale::pointsMap(lat, long, data=d)
zoom <- attr(dmap,"zoom")
 

# maptiles ----
# zoom needs to be automated, bad resolution, no scalebar etc, but could be projected
dsf <- sf::st_as_sf(d, coords=c("long", "lat"), crs=4326)
bounds <- sf::st_bbox(dsf)
maptiles::plot_tiles(maptiles::get_tiles(bounds, crop=T, zoom=zoom, project=FALSE,
                                         cachedir="maptilescache"), adjust=F) 

# rosm ----
# bad resolution, no scalebar etc, but has autozoom (unlike maptiles)
bounds2 <- sf::st_bbox(sf::st_transform(dsf, "EPSG:3857"))
bounds2 <- wk::rct(bounds2$xmin, bounds2$ymin, bounds2$xmax, bounds2$ymax, crs="EPSG:3857")
rmap <- rosm::osm_raster(bounds2, rosm::osm_url_spec(), zoom=zoom)
rmap <- wk::grd_crop(rmap, bounds2)
plot(rmap)


# leaflet screenshot ----
# external image (not within R), no zoom control, no scalebar etc
library(leaflet)
dl <- leaflet(d) %>% addTiles() %>%  addCircles(~long, ~lat) ; dl
mapview::mapshot(dl, file="map.png") ; berryFunctions::openFile("map.png")

Edit: I opened issues on resolution at paleolimbot/rosm#30 and riatelab/maptiles#27

from osmscale.

brry avatar brry commented on August 17, 2024

Thank you so much for all your work in the spatial transition!

The last commit to OpenStreetMap (as referenced above) was 4 years ago.
Shoud I try to move the core code to rosm? Note this is diffferent from the ROSM above.
Since 2019, rosm is expected to retire "next year", so I'm not sure if it's worth it..

What is currently the best option for quick static maps with an OSM background?

from osmscale.

rsbivand avatar rsbivand commented on August 17, 2024

I am not sure what now matches best, since interactive mapping has taken over a good deal of the activity in those kinds of tasks. I use mapview or tmap and take a screenshot for record (can be scripted); ggmap is also a possibility though I don't use it. OpenStreetMap as you say has not been changed for some time - the issue there is 4 months old with no reaction. Perhaps the underlying technology has outlived its usefulness?

from osmscale.

rsbivand avatar rsbivand commented on August 17, 2024

I asked the maintainer of loa to collaborate too, but it may be sensible to work around OpenStreetMap.

from osmscale.

rsbivand avatar rsbivand commented on August 17, 2024

@brry ifellows/ROSM#15 has not yet been resolved, I'm afraid. Could you please either work around or help in getting the update to CRAN in time?

from osmscale.

brry avatar brry commented on August 17, 2024

I will look at using rosm instead.

from osmscale.

brry avatar brry commented on August 17, 2024

It looks like I will use maptiles instead, as loading rosm also triggers the rgdal messages. I need to at least figure out (i.e. copy from elsewhere) a default zoom value mechanism.

Edit: I loaded an old version of rosm, the new version works fine.

from osmscale.

rsbivand avatar rsbivand commented on August 17, 2024

@brry Please submit the new version to CRAN ASAP.

R spatial infrastructure packages maptools, rgdal and rgeos will be archived by CRAN on Monday, October 16, 2023. Your package does not pass CMD check when these packages are not available. Expect your package to be archived by CRAN October 17-18 as CRAN checks feed through and your package fails, if not updated by Monday, October 16, 2023.

No grace period is anticipated, as you have had sufficient time to update your package to remove dependencies on maptools, rgdal and/or rgeos, or on packages that you import that have not met the deadline.

from osmscale.

brry avatar brry commented on August 17, 2024

Ian Fellows is updating OpenStreetMap - it's already on github and should be on its way to CRAN soon.

I am also updating OSMscale to not need sp anymore :)

from osmscale.

rsbivand avatar rsbivand commented on August 17, 2024

@brry OK, thanks!

from osmscale.

rsbivand avatar rsbivand commented on August 17, 2024

Looks OK with OpenStreetMap 0.4.0, thanks for your cooperation!

from osmscale.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.