OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2008-07-24 13:06:38

acb
Member
Registered: 2008-07-24
Posts: 1

Good practice for programmatically fetching tiles

Hi;

I've started working on a script for making maps browsable on a Palm PDA (using the free MapView app) from OpenStreetMap tiles. It's still at the very rudimentary stages, though code will be posted once it's in better form.

I was wondering what good practice is for automatically fetching large numbers of tiles. My script will start with tiles at a high-level zoom (i.e., a city or town) and then fetch their subtiles at a few levels of zoom below that (possibly skipping every second one to keep things manageable). Given that the number of tiles increases exponentially with each zoom level, this can put quite a load on the server.

My script currently throttles its requests by pausing for 5 seconds after every 16 tiles have been downloaded (simulating a browser window showing (part of) 4x4 tiles at once). Is this acceptable? Could I go wild and do away with the throttling altogether?

Also, I've noticed that the tile URLs start with 'a.tile.openstreetmap.org'. Should the 'a' be omitted? If it is, will requests automatically be rotated between tile servers?

Thanks,

-- acb

Offline

#2 2008-07-24 16:20:01

Lambertus
Administrator
From: Apeldoorn (NL)
Registered: 2007-03-17
Posts: 3,269
Website

Re: Good practice for programmatically fetching tiles

If your application is going to attract a reasonable following then the OSM server admin's won't be very happy with your chosen solution. In such a case it is better to host your own tileserver. That said, using the OSM servers for testing purposes is just fine, in that case throttling should not be necessary.

Regarding the URL's: if you look at the source of some webbased mapservers based on OpenLayers you will see they cycle through 4 servers a, b, c and d to get the tiles in parallel.


Mapping tools: Garmin GPSmap 60CSx, Giant Terrago 2002

Offline

Board footer

Powered by FluxBB