0

I went to Open Street Map to download a small area of a city (Toronto) I'm making a map for. When I went to Export it, I tried to manually adjust the northern bounding box at this url

https://www.openstreetmap.org/api/0.6/map?bbox=-[mycoordinates]%2C[mycoordinates]%2C[mycoordinates]%2C[mycoordinates]

But it said the api is down

The webpage at https://www.openstreetmap.org/api/0.6/map?bbox=-79.4026%2C43.6418%2C-79.3641%2C43.6689 might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE

I then tried to do a download without adjusting the bounding box and got the same message.

However, I then went to New York City on OpenStreetMap and tested an export from there, and it worked fine. Going back to my city, it still doesn't work.

How is it possible the api works for some cities but not others?

  • I tried to do the New York City export about an hour after writing this question and it also didn't work (same response) so I'm guessing there's no point to the question and the fact that it worked for one city but not another was just random (i.e. the service was/is down) – Leahcim Mar 29 '18 at 11:53
  • @mmd thank you for the contributing, but your comment is inappropriate. The error message was posted in the OP and it doesn't say what you have written here. – Leahcim Mar 29 '18 at 20:57
  • Note, the api response I posted in the OP says, "might be temporarily down or it may have moved permanently to a new web address. ERR_INVALID_RESPONSE" – Leahcim Mar 29 '18 at 21:36
  • This is the OSM editing API. It must not be used for downloading large extracts! – scai Apr 9 '18 at 6:59
4

Rather than trying to use "export" at the OpenStreetMap website, I'd try and get the data from a data extract instead, such as http://download.geofabrik.de/north-america/canada/ontario.html . You can select the data that you want from that download by using something like https://wiki.openstreetmap.org/wiki/Osmosis or https://wiki.openstreetmap.org/wiki/Osmium . You might find some of the questions that match these tags at the OSM help site useful.

  • Thank you for the response but I cannot accept it as an answer, since it doesn't answer the question. However, I appreciate the extra information you have provided. – Leahcim Mar 29 '18 at 21:04
  • 1
    This a perfectly valid answer. You’re trying to download too much data via this endpoint which got rejected by the server to stop abuse. Using an extract is way to go! – mmd Mar 30 '18 at 5:54
2

"Friendly" HTTP error messages at work, making you believe that the site is not available. That's of course not the real reason, as your browser is simply hiding the original error message!

Fetching the URL you posted via a command line tool, such as curl, makes it immediately obvious that you're trying to download too much data, both by an HTTP 400 error message as well as the error text: You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm

curl -v https://www.openstreetmap.org/api/0.6/map?bbox=-79.4026%2C43.6418%2C-79.3641%2C43.6689
*   Trying 193.63.75.99...
* Connected to www.openstreetmap.org (193.63.75.99) port 443 (#0)
[...]
> GET /api/0.6/map?bbox=-79.4026%2C43.6418%2C-79.3641%2C43.6689 HTTP/1.1
> Host: www.openstreetmap.org
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 400 Bad Request
< Date: Fri, 30 Mar 2018 08:15:45 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Content-Disposition: attachment; filename="map.osm"
< Error: You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm
< Cache-Control: no-cache
< Content-Length: 95
< Strict-Transport-Security: max-age=31536000
< Content-Type: text/plain; charset=utf-8
< Connection: close
< 
* Closing connection 0
You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm

@SomeoneElse already posted a solution for this issue: use an extract instead. The /map endpoint is not supposed to be used for downloading mass data, like you're trying to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.