Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct use of OSM resources #1289

Closed
1 task done
monsieurtanuki opened this issue Mar 6, 2019 · 2 comments
Closed
1 task done

Correct use of OSM resources #1289

monsieurtanuki opened this issue Mar 6, 2019 · 2 comments
Assignees
Milestone

Comments

@monsieurtanuki
Copy link
Collaborator

Issue Type

  • Improvement

Description and/or steps/code to reproduce the problem

Our current default tile provider is MAPNIK (in short, https://a.tile.openstreetmap.org/z/x/y.png).
Users recently had problems downloading MAPNIK tiles (#1286, #1288, possibly #1259, #1276)
I contacted the OpenStreetMap.org sysadmin team; they (@Firefishy) replied:

Yes, we have blocked the unset default user-agent of osmdroid. Please set a real app user-agent [...] and your app(s) will work again.
Please be aware we have a usage policy and because our services are so overloaded we are having to start strictly enforcing it: https://operations.osmfoundation.org/policies/tiles/
NO BULK DOWNLOADING!

The goal is to implement stronger checks or default modes in osmdroid in order to have a reasonable use of MAPNIK.

Environment

Version of osmdroid the issue relates to:

All

@monsieurtanuki monsieurtanuki self-assigned this Mar 6, 2019
@monsieurtanuki
Copy link
Collaborator Author

I was about to PR, when I made one of my trademark github mistakes.
I'll try to PR tomorrow, now I'm too depressed...

monsieurtanuki added a commit that referenced this issue Mar 7, 2019
…arly for MAPNIK

New classes:
* `TileSourcePolicy`: tile source usage policy, including the max number of concurrent downloads, if it accepts a meaningless user agent, and if it accepts bulk downloads
* `TileSourcePolicyException`: `RuntimeException` dedicated to the enforcement of online tile source usage policies (`TileSourcePolicy`)

Impacted classes:
* `CacheManager`: the constructors now throw `TileSourcePolicyException` if the online tile source doesn't accept bulk downloads
* `DefaultConfigurationProvider`: created the static member `DEFAULT_USER_AGENT` in order to store the default user agent (if the actual user agent equals that default value, enforcement of some tile source policies will reject the downloads for this tile source)
* `OnlineTileSourceBase`: added a `TileSourcePolicy` member and its setter; replaced the `int pMaxConcurrent` parameter of a constructor with a broader `TileSourcePolicy` parameter
* `SampleCacheDownloaderArchive`: replaced the tile source (default:MAPNIK) with one that accepts bulk downloads (HIKEBIKEMAP); embedded each `new CacheManager` piece in a try/catch syntax because of the new thrown `TileSourcePolicyException`
* `TileDownloader`: checking the tile source usage policy regarding the value of the user agent
* `TileSourceFactory`: changed the definition of tile source MAPNIK - now we enforce a tighter policy (no meaningless user agent, no bulk downloads)
* `XYTileSource`: replaced the `int pMaxConcurrent` parameter of a constructor with a broader `TileSourcePolicy` parameter
monsieurtanuki added a commit that referenced this issue Mar 7, 2019
feature/#1289 - online tile source usage policy enforcement, particularly for MAPNIK
@monsieurtanuki
Copy link
Collaborator Author

Merged. I also added a chapter in the FAQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant