Question

I need to download some tiles to use them offline in a webpage using JTileDownloader, version 0-6-1.

When I use Mapnik as the source, it get a 'Forbidden' message. what may be happening?

I've heard that this happens if you don't declare an user-agent, but the programs seem not to offer this option.

Anyhow, does anybody know an option to download tiles through Mapnik?

Était-ce utile?

La solution

This tile grabber was forbidden from downloading tiles by OSM administrators. They did not listen to any reasoning for allowing it to download tiles. The policy is that they block all tile downloaders, regardless of how it works.

If a tile layer does not matter, use another one, like MapQuest Open.

Now, to download tiles, JTileDownloader is the best option, because it is easy on a server, having delays between requests and downloading tiles in quadtile order. You will have to change User-Agent string, and for that you'll need to recompile the project. Download the source code:

svn co http://svn.openstreetmap.org/applications/utils/downloading/JTileDownloader/trunk/ JTileDownloader

Then find TileListDownloader.java in src/org/... and find a string Agent inside it. Replace JTileDownloader with any other word, and then compile and run the new version with ant run in JTD's root directory.

Note that you should not download too many tiles, that is, more than a couple thousand. If you need more, please install PostgreSQL and Mapnik and generate as many tiles as you like locally.

Autres conseils

Older versions of differend tile grabbers got blocked as they didn't respected OSMs Tile usage policy and stressed the servers.

You are free to upgrade or pick other similar applications, choose a different 3rd party OSM map provider, or setup your own renderer for offline rendering.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top