Skip to content

Add support for limited concurrency XYZ downloads, and Mapbox maps#11

Merged
rudokemper merged 6 commits into
mainfrom
concurrent-downloads-with-rate-limiting
Jan 29, 2024
Merged

Add support for limited concurrency XYZ downloads, and Mapbox maps#11
rudokemper merged 6 commits into
mainfrom
concurrent-downloads-with-rate-limiting

Conversation

@rudokemper
Copy link
Copy Markdown
Member

@rudokemper rudokemper commented Jan 29, 2024

Goal

This PR adds two options for online sources: mapbox for any custom Mapbox style, and mapbox-satellite, which is Mapbox's satellite imagery style. Both require an access token (and the CLI raises an error if either option is selected without one.)

Additionally, this PR introduces p-limit to be able to do concurrent downloads of XYZ tiles with Promise.all without running into rate limiting from any API (Bing, specifically). A limit of 5 seems to work fine and still substantially speed things up compared to individual image downloads async.

Screenshots

Screenshot from 2024-01-25 23-51-26
XYZ tiles from a Mapbox style

@rudokemper rudokemper merged commit d5df317 into main Jan 29, 2024
@rudokemper rudokemper deleted the concurrent-downloads-with-rate-limiting branch January 29, 2024 12:20
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

Successfully merging this pull request may close these issues.

1 participant