README.md
October 8, 2023 路 View on GitHub
tinygpkg-data
Small, TWKB compressed, and simplified GeoPackage datasets to be used with tinygpkg.
Report Bug
路
Request Feature
Table of Contents
About
This repository contains a set of scripts and tools for generating Tiny Well-known Binary (TWKB) compressed GeoPackage files from various open data sources. Check out Featured Variants or releases to download the data or keep reading for more details and comparisons.
Datasets
| Name | Contents | Features | Source | License |
|---|---|---|---|---|
| ne_110m_admin_0_countries | Country borders, 1:110m scale | 177 | Natural Earth | Public Domain |
| ne_10m_admin_0_countries | Country borders, 1:10m scale | 258 | Natural Earth | Public Domain |
| ne_10m_urban_areas_landscan | Big cities only, 1:10m scale | 6018 | Natural Earth | Public Domain |
| geoBoundariesCGAZ_ADM0 | Country-level administrative boundaries | 200 | geoBoundaries | Attribution required |
| geoBoundariesCGAZ_ADM2 | City-level administrative boundaries | 49689 | geoBoundaries | Attribution required |
Featured Variants
These are some selected useful variants of the datasets. See Variants for the full list.
| File | Description | Size (vs. source) | Gzipped size (vs. source) |
|---|---|---|---|
| Tiny (TWKB) | |||
| 馃摜聽ne_110m_admin_0_countries_s5_twkb_p3 | 117 country borders | 393鈥疜B 46.9% of 838鈥疜B | 116鈥疜B 56.0% of 208鈥疜B |
| 馃摜聽ne_10m_admin_0_countries_s4_twkb_p3 | 258 country borders | 1249鈥疜B 9.4% of 13287鈥疜B | 782鈥疜B 17.0% of 4614鈥疜B |
| 馃摜聽ne_10m_urban_areas_landscan_s5_twkb_p3 | 6018 city borders | 4333鈥疜B 7.5% of 57682鈥疜B | 1780鈥疜B 22.0% of 8078鈥疜B |
| 馃摜聽geoBoundariesCGAZ_ADM2_s5_twkb_p3 | 49689 city borders | 16420鈥疜B 6.0% of 272859鈥疜B | 10782鈥疜B 6.4% of 168993鈥疜B |
| Compatible (WKB) | |||
| 馃摜聽ne_110m_admin_0_countries_s5_wkb | 117 country borders | 557鈥疜B 66.4% of 838鈥疜B | 215鈥疜B 103.8% of 208鈥疜B |
| 馃摜聽ne_10m_admin_0_countries_s4_wkb | 258 country borders | 4997鈥疜B 37.6% of 13287鈥疜B | 2566鈥疜B 55.6% of 4614鈥疜B |
| 馃摜聽ne_10m_urban_areas_landscan_s5_wkb | 6018 city borders | 21704鈥疜B 37.6% of 57682鈥疜B | 4663鈥疜B 57.7% of 8078鈥疜B |
| 馃摜聽geoBoundariesCGAZ_ADM2_s5_wkb | 49689 city borders | 52469鈥疜B 19.2% of 272859鈥疜B | 34726鈥疜B 20.5% of 168993鈥疜B |
Parameters
The makevalid variant is the original source file converted to GeoPackage
format using ogr2ogr with the -makevalid flag. This ensures a consistent
intermediary format with valid geometry that is then further simplified and
compressed.
Source datasets are minified using two methods, simplification and Tiny Well-known Binary (TWKB) compression.
Simplification is performed using the Ramer-Douglas-Peucker Simplify method on the polygons. If the simplification fails (creates an invalid polygon), less and less simplification is used until the polygon remains valid. If the polygon has less than "Min. Points", it is not simplified.
Precision is the maximum number of decimal places used to store the coordinates using TWKB. From empirical testing, less than 3 decimal places does not save a lot of space and more than 3 decimal places does not gain a lot in precision for these datasets.
The wkb variants are only simplified and not compressed, keeping the original
Well-known Binary (WKB) format. This increases compatibility with other tools at
the cost of larger file size.
| Name | Simplify | Min. Points | Precision |
|---|---|---|---|
| makevalid | none | n/a | full |
| s3_twkb_p3 | 1 | 20 | 3 |
| s4_twkb_p3 | 0.1 | 20 | 3 |
| s5_twkb_p3 | 0.01 | 20 | 3 |
| s6_twkb_p3 | 0.001 | 20 | 3 |
| s7_twkb_p3 | 0.0001 | 20 | 3 |
| s8_twkb_p3 | 0.00001 | 20 | 3 |
| s3_wkb | 1 | 20 | full |
| s4_wkb | 0.1 | 20 | full |
| s5_wkb | 0.01 | 20 | full |
| s6_wkb | 0.001 | 20 | full |
| s7_wkb | 0.0001 | 20 | full |
| s8_wkb | 0.00001 | 20 | full |
Variants
These are the variants of the datasets available. Each variant is a combination of the parameters described above.
ne_110m_admin_0_countries
Country borders, 1:110m scale sourced from Natural Earth (Public Domain).
See Parameters for what each variant means and Datasets for details on the dataset itself.
| Variant | Size | world | europe | africa | usa | japan |
|---|---|---|---|---|---|---|
| 馃摜聽makevalid | 569鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_twkb_p3 | 352鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_twkb_p3 | 393鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_twkb_p3 | 393鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_twkb_p3 | 393鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_twkb_p3 | 393鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_twkb_p3 | 393鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_wkb | 409鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_wkb | 520鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_wkb | 557鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_wkb | 557鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_wkb | 557鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_wkb | 557鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
ne_10m_admin_0_countries
Country borders, 1:10m scale sourced from Natural Earth (Public Domain).
See Parameters for what each variant means and Datasets for details on the dataset itself.
| Variant | Size | world | europe | africa | usa | japan |
|---|---|---|---|---|---|---|
| 馃摜聽makevalid | 9457鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_twkb_p3 | 921鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_twkb_p3 | 1249鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_twkb_p3 | 1441鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_twkb_p3 | 1810鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_twkb_p3 | 2146鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_twkb_p3 | 2158鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_wkb | 3002鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_wkb | 4997鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_wkb | 5984鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_wkb | 8462鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_wkb | 9179鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_wkb | 9297鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
ne_10m_urban_areas_landscan
Big cities only, 1:10m scale sourced from Natural Earth (Public Domain).
See Parameters for what each variant means and Datasets for details on the dataset itself.
| Variant | Size | world | berlin | nyc | tokyo | ljubljana |
|---|---|---|---|---|---|---|
| 馃摜聽makevalid | 48156鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_twkb_p3 | 5599鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_twkb_p3 | 3788鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_twkb_p3 | 4333鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_twkb_p3 | 6119鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_twkb_p3 | 6131鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_twkb_p3 | 6127鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_wkb | 30052鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_wkb | 18726鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_wkb | 21704鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_wkb | 34611鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_wkb | 34639鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_wkb | 34643鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
geoBoundariesCGAZ_ADM0
Country-level administrative boundaries sourced from geoBoundaries (Attribution required).
See Parameters for what each variant means and Datasets for details on the dataset itself.
| Variant | Size | world | europe | africa | usa | japan |
|---|---|---|---|---|---|---|
| 馃摜聽makevalid | 157384鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_twkb_p3 | 11522鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_twkb_p3 | 14368鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_twkb_p3 | 17473鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_twkb_p3 | 18358鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_twkb_p3 | 20705鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_twkb_p3 | 28446鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_wkb | 29437鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_wkb | 49922鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_wkb | 67690鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_wkb | 72953鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_wkb | 89964鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_wkb | 135143鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
geoBoundariesCGAZ_ADM2
City-level administrative boundaries sourced from geoBoundaries (Attribution required).
See Parameters for what each variant means and Datasets for details on the dataset itself.
| Variant | Size | world | europe | africa | usa | japan |
|---|---|---|---|---|---|---|
| 馃摜聽makevalid | 266186鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_twkb_p3 | 42856鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_twkb_p3 | 15691鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_twkb_p3 | 16420鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_twkb_p3 | 25751鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_twkb_p3 | 37814鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_twkb_p3 | 44625鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s3_wkb | 232214鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s4_wkb | 54140鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s5_wkb | 52469鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s6_wkb | 128806鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s7_wkb | 208105鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
| 馃摜聽s8_wkb | 246050鈥疜B | ![]() | ![]() | ![]() | ![]() | ![]() |
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Code and tools distributed under the MIT License. The license of the datasets follows the license of the sources used to generate them. See LICENSE.md for more information.




































































































































































































































































































































