You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
provide an estimation of total size for offline regions #4258
Tile sizes are variable, so there is no way to calculate the precise size of an arbitrary offline region other than downloading it and then summing the actual size. However, we can make several types of estimates. In descending order of likely accuracy:
Estimates based on the size of tiles already downloaded. We could assume that the remainder of the tiles will be a similar size, and estimate accordingly.
Estimates based on average tile sizes for particular sources. For frequently used sources such as mapbox-streets-v7, we can calculate typical tile sizes. To be useful, they would need to have at least zoom-level granularity: an estimated average tile size for each zoom level from 0 to 16. Then we could estimate by multiplying by the number of tiles in the region at each zoom level.
A nominal "typical tile size" estimate. Likely broken down at least to: 512px vector tile, 256px raster tile, 512px raster tile, 256px@2x raster tile, 512px@2x raster tile. This would be a fairly inaccurate fallback for unknown sources.
You might be under the impression that offline is implemented by requesting some sort of single archive from the server. That isn't the case: an offline "download" is just a bunch of individual requests for each of the required resources. The server doesn't have any special knowledge of the offline region as a whole which it could use to calculate the total size. Among other benefits, this means that offline features aren't limited to Mapbox APIs. A server side implementation that was able to calculate a total size would either be proprietary, or require some sort of open protocol specification.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Activity
mb12 commentedon Mar 9, 2016
@jfirebaugh Why can't you do it on the server side?
jfirebaugh commentedon Mar 9, 2016
You might be under the impression that offline is implemented by requesting some sort of single archive from the server. That isn't the case: an offline "download" is just a bunch of individual requests for each of the required resources. The server doesn't have any special knowledge of the offline region as a whole which it could use to calculate the total size. Among other benefits, this means that offline features aren't limited to Mapbox APIs. A server side implementation that was able to calculate a total size would either be proprietary, or require some sort of open protocol specification.
mb12 commentedon Mar 9, 2016
@jfirebaugh Without server side support, how do you compute what code points to download for a font set?
jfirebaugh commentedon Mar 9, 2016
We download them all: #4069.
daniel-choi commentedon Jan 19, 2018
Hi all! Any updates on this issue or #9460?
stale commentedon Oct 28, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
stale commentedon Dec 6, 2018
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
stale commentedon Jun 4, 2019
This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.
Hartistic commentedon Sep 28, 2021
This should be reopened, there is a huge use case for this and Mapbox could provide an easier way to estimate the file size.