brajabasi / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

Download from several servers in parallel #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Description copied from issue 27 comment 3:

Download from several servers in parallel, generally possible for all,
implemented for the CYCLEMAP

    CYCLEMAP(R.string.cyclemap, ".png", 0, 17, 8, CodeScheme.X_Y,
            "http://a.andy.sandbox.cloudmade.com/tiles/cycle/",
            "http://b.andy.sandbox.cloudmade.com/tiles/cycle/",
            "http://c.andy.sandbox.cloudmade.com/tiles/cycle/"),

You can use the OpenStreetMapRendererInfo with several servers now, and the 
implementation picks randomly one of the servers. This seems to improve the 
download 
speed enormously. Checking the URLs in parallel with a Firefox sometimes shows 
a 404 
on some tiles, indicating a server problem which is harmless, if you can try 
lots of 
servers.

Room for improvement, choose the servers according to their response time... 

The cyclemap now feels better than the Google maps!

Original issue reported on code.google.com by neilboyd on 3 May 2010 at 7:30

GoogleCodeExporter commented 8 years ago
Description should have said point 3 of comment 18.

Also the title is not very accurate - it only downloads each tile from one 
server at a 
time.

Committed in revision 151.

I didn't commit the change to PUT instead of GET. What was the reason for that, 
Thomas?

Original comment by neilboyd on 3 May 2010 at 8:26

GoogleCodeExporter commented 8 years ago
Effectively, it does download different tiles from different servers in 
parallel, I
think. I did not check.

But, you are right, looking at a single tile, which might be unavailable on a 
certain
server and now is tried to be downloaded server after server.

Sorry for the confusion.

I do not remember the PUT/GET issue. Probably my misunderstanding how the Linked
Hashmap works, trying to outsmart the cache. But you are right to filter it out.

Original comment by thomas.f...@gmail.com on 3 May 2010 at 2:07

GoogleCodeExporter commented 8 years ago
You changed the simple URL.openStream to a HttpURLConnection and set the method 
to 
POST. And then closed the connection and not the two streams. That's what I 
meant by 
PUT (sic).

Original comment by neilboyd on 3 May 2010 at 3:21

GoogleCodeExporter commented 8 years ago

Original comment by neilboyd on 10 Sep 2010 at 2:36