I spent the afternoon trying to figure out a workflow for ggmap
as an alternative to arcGIS for my team.
I continued to be hung up on the get_map
command. Google needs an authorization, and when I try to use "osm"
, I get the following error:
> get_map("portland, oregon", source = "osm")
Error in download.file(url, destfile = tmp, quiet = !messaging, mode = "wb") :
cannot open URL 'http://maps.googleapis.com/maps/api/staticmap?center=portland,+oregon&zoom=10&size=640x640&scale=2&maptype=terrain&sensor=false'
In addition: Warning message:
In download.file(url, destfile = tmp, quiet = !messaging, mode = "wb") :
cannot open URL 'http://maps.googleapis.com/maps/api/staticmap?center=portland,+oregon&zoom=10&size=640x640&scale=2&maptype=terrain&sensor=false': HTTP status was '403 Forbidden'
I also work in Julia and saw the package OpenStreetMapXPlot. This package allows you to use an existing .osm
file that is saved locally to make a plot. It works immediately as intended.
Is there a way to use a local .osm
file to get the right kind of object returned from get_map()
calls? Such a feature would be very useful. Let me know if this question is too niche and if I should post at the git repo.
EDIT: I have a slightly different error message, based off of this issue I am now able to ping the osm database, but still get an error about access.
> portland_bb = getbb("portland, oregon")
> get_openstreetmap(bbox = portland_bb)
Error: map grabbing failed - see details in ?get_openstreetmap.
In addition: Warning message:
In download.file(url, destfile = destfile, quiet = !messaging, mode = "wb") :
cannot open URL 'http://tile.openstreetmap.org/cgi-bin/export?bbox=-122.8367489,45.432536,-122.4720252,45.6528812&scale=606250&format=png': HTTP status was '400 Bad Request'