Search code examples
androidjaropenstreetmaphttp-status-code-403

Unable to download map data from OpenStreetMap


While executing

`java -jar OSMMapTilePackager-6.1.1-SNAPSHOT.jar -u http://b.tile.openstreetmap.org/%d/%d/%d.png -t Mapnik -d at_mapnik_13.zip -zmax 15 -n 49.03942 -s 46.40162 -e 17.14736 -w 9.44595`

I get 403 (Forbidden access), but when I execute it in the browser, I get a tile as an image file.

Is there something related to the policy that I have missed. I am trying to download map files and use them for offline use.

Thanks in advance!


Solution

  • Bulk downloads are usually forbidden. See the tile usage policy. Quoting the important parts:

    OpenStreetMap’s own servers are run entirely on donated resources.

    OpenStreetMap data is free for everyone to use. Our tile servers are not.

    Bulk downloading is strongly discouraged. Do not download tiles unnecessarily. In particular, downloading significant areas of tiles at zoom levels 17 and higher for offline or later usage is forbidden [...]

    You can render your own raster tiles by installing a rendering software such as TileMill or by installing your own tile-server. Alternatively take a look at Commercial OSM software and services.

    Alternatively switch to vector tiles. Obtaining raw OSM data is rather easy. Vector tiles allow you to render tiles on your device on the fly.