0

Hello,

I am trying to load up a norway map using 'osm' within R,

myLocation <- c(lon = 17.468946, lat = 66.87202)
myMap <- get_map(location=myLocation,source="osm", color='bw')
ggmap(myMap)

I am getting error saying service unavailable-

Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=66.87202,17.468946&zoom=10&size=640x640&maptype=terrain&sensor=false 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: HTTP status was '503 Service Unavailable'

Any ideas?

asked 13 Mar '15, 10:13

aborg88's gravatar image

aborg88
1111
accept rate: 0%

edited 13 Mar '15, 11:35

scai's gravatar image

scai ♦
31.9k20291442

I very much doubt that a maptype=terrain through the google map api would give you OSM data, or is this just an example of the area?

(13 Mar '15, 11:51) SK53 ♦

2 Answers:
4

You don't say but this looks like the ggmap package (http://cran.r-project.org/web/packages/ggmap/ggmap.pdf) which appears to use the Export function of the OSM API to provide a raster image . The latter hardly ever works because it is very resource intensive and it rarely gets cycles because of the standard load on tile servers.

Additionally if this ever became heavily used it might be seen as a tile scraping application (see the get_cloudmade and get_stamen function documentation) which is contarary to OSM's Terms of Service.

In summary this is probably not working because it is using part of the OSM API which rarely functions for performance/load balancing reasons.

For vector data in R, the osmar package is probably the best choice.

permanent link

answered 13 Mar '15, 11:55

SK53's gravatar image

SK53 ♦
23.6k46238372
accept rate: 20%

3

ggmap package seems buggy. Why ask to google API for retrieving osm tiles? Maybe you may try the package 'OpenStreetMap': http://blog.fellstat.com/?cat=15 I've tested it, and it works fine.

permanent link

answered 13 Mar '15, 11:47

NicolasDumoulin's gravatar image

NicolasDumoulin
3.3k42256
accept rate: 13%

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×8

question asked: 13 Mar '15, 10:13

question was seen: 12,530 times

last updated: 13 Mar '15, 11:55

powered by OSQA