Hi, I am currently creating a slippy map for Java. Not Javascript, Java. The tile usage policy appears to be geared more towards using a browser, which I am not. Can somebody clarify it for me?
What do i use for a user-agent identifier?
So I can only request one thread to http://[abc].tile.openstreetmap.org/zoom/x/y.png eg. my api requests: http://a.tile.opentstreetmap.org/8/2323/5465.png and http://b.tile.opentstreetmap.org/8/4542/7657.png but it can't make another request like this: http://c.tile.opentstreetmap.org/8/56565/7867.png until a and b are finished loading? Also can I send two requests to the same server? so i send two requests to a and b? thank you! asked 04 Aug '11, 18:24 meerkat_aicml |
The User-Agent is the name of your program. It is important for identifying what application is violating the terms and can be used to block those versions of the program. There are currently only two servers that are serving tiles. The [abc].tile.openstreetmap.org and tile.openstreetmap.org each map to one of theese two servers. The most important is that you do not send to many requests to the servers at once. The problem is people that are downloading a lot of tiles for offload use where most tiles are not displayed to any users. If you are woried that you may download too many tiles too fast you can always set up your own tile server. answered 04 Aug '11, 19:30 Gnonthgol ♦ dieterdreist Thank you for clarifying. Out of curiosity how many requests is too many?
(04 Aug '11, 20:29)
meerkat_aicml
3
The statement about the two servers is incorrect - all addresses map to the same cache server, and there is another server generating tiles behind that. In any case, the "2 threads" limit are to any and all addresses combined. So if you wanted to use two addresses, you could only download 1 tile at a time from each.
(05 Aug '11, 09:17)
Andy Allan
Okay so would it be any faster to use two addresses than one? Or would the server treat both requests the same?
(05 Aug '11, 16:37)
meerkat_aicml
1
Just for the record, [abc].tile do currently map onto two caching servers (konqi,albi), which are front ends to a single server. Funnily enough, the aliases [abc] are actually there explicitly to violate this policy of two threads. By default browsers only open n simultanoius connections per domain. In order to get the browser to open more simultanious connections and reduce latency, aliases are introduced which each get n connections. So in Java it doesn't really matter to which server you connect and you might as well only use tile.osm.org, although in future that might change.
(05 Aug '11, 22:34)
apmon
3
The policies are generally written to prevent server overload from massive automated downloads, that can quickly rack up 10.000s of tiles. The policy kind of works as "if it causes troubles to the servers" it is "illegal". If the load is low and no admin notices it is fine. So what is allowed and what not is kind of fuzzy. To get an indication of what gets noticed: http://wiki.openstreetmap.org/wiki/Talk:Tile_usage_policy#Usage_stats_for_Monday_1st_March_2010 http://munin.openstreetmap.org/openstreetmap/yevaud.openstreetmap/index.html#mod_tile
(05 Aug '11, 22:41)
apmon
|
You may want to take a look at: http://wiki.openstreetmap.org/wiki/LiveMapViewer It is written in java, it uses "slippy map" and it's source code is available.
Have a look at JMapViewer ( http://trac.openstreetmap.org/browser/applications/viewer/jmapviewer )
JMapViewer is a Java Swing component for integrating OSM maps in to your Java application.
LiveEditMapViewer mentioned in the comment above uses jmapviewer as its slippy map component.