README.md

October 8, 2023View on GitHub


Logo

tinygpkg-data

Small, TWKB compressed, and simplified GeoPackage datasets to be used with tinygpkg.

Report BugRequest Feature

Table of Contents
  1. About
  2. Datasets
  3. Featured Variants
  4. Parameters
  5. Variants
  6. Contributing
  7. License
  8. Acknowledgements

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

NameContentsFeaturesSourceLicense
ne_110m_admin_0_countriesCountry borders, 1:110m scale177Natural EarthPublic Domain
ne_10m_admin_0_countriesCountry borders, 1:10m scale258Natural EarthPublic Domain
ne_10m_urban_areas_landscanBig cities only, 1:10m scale6018Natural EarthPublic Domain
geoBoundariesCGAZ_ADM0Country-level administrative boundaries200geoBoundariesAttribution required
geoBoundariesCGAZ_ADM2City-level administrative boundaries49689geoBoundariesAttribution required

These are some selected useful variants of the datasets. See Variants for the full list.

FileDescriptionSize (vs. source)Gzipped size (vs. source)
Tiny (TWKB)
馃摜聽ne_110m_admin_0_countries_s5_twkb_p3117 country borders393鈥疜B
46.9% of 838鈥疜B
116鈥疜B
56.0% of 208鈥疜B
馃摜聽ne_10m_admin_0_countries_s4_twkb_p3258 country borders1249鈥疜B
9.4% of 13287鈥疜B
782鈥疜B
17.0% of 4614鈥疜B
馃摜聽ne_10m_urban_areas_landscan_s5_twkb_p36018 city borders4333鈥疜B
7.5% of 57682鈥疜B
1780鈥疜B
22.0% of 8078鈥疜B
馃摜聽geoBoundariesCGAZ_ADM2_s5_twkb_p349689 city borders16420鈥疜B
6.0% of 272859鈥疜B
10782鈥疜B
6.4% of 168993鈥疜B
Compatible (WKB)
馃摜聽ne_110m_admin_0_countries_s5_wkb117 country borders557鈥疜B
66.4% of 838鈥疜B
215鈥疜B
103.8% of 208鈥疜B
馃摜聽ne_10m_admin_0_countries_s4_wkb258 country borders4997鈥疜B
37.6% of 13287鈥疜B
2566鈥疜B
55.6% of 4614鈥疜B
馃摜聽ne_10m_urban_areas_landscan_s5_wkb6018 city borders21704鈥疜B
37.6% of 57682鈥疜B
4663鈥疜B
57.7% of 8078鈥疜B
馃摜聽geoBoundariesCGAZ_ADM2_s5_wkb49689 city borders52469鈥疜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.

NameSimplifyMin. PointsPrecision
makevalidnonen/afull
s3_twkb_p31203
s4_twkb_p30.1203
s5_twkb_p30.01203
s6_twkb_p30.001203
s7_twkb_p30.0001203
s8_twkb_p30.00001203
s3_wkb120full
s4_wkb0.120full
s5_wkb0.0120full
s6_wkb0.00120full
s7_wkb0.000120full
s8_wkb0.0000120full

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.

VariantSizeworldeuropeafricausajapan
馃摜聽makevalid569鈥疜B
馃摜聽s3_twkb_p3352鈥疜B
馃摜聽s4_twkb_p3393鈥疜B
馃摜聽s5_twkb_p3393鈥疜B
馃摜聽s6_twkb_p3393鈥疜B
馃摜聽s7_twkb_p3393鈥疜B
馃摜聽s8_twkb_p3393鈥疜B
馃摜聽s3_wkb409鈥疜B
馃摜聽s4_wkb520鈥疜B
馃摜聽s5_wkb557鈥疜B
馃摜聽s6_wkb557鈥疜B
馃摜聽s7_wkb557鈥疜B
馃摜聽s8_wkb557鈥疜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.

VariantSizeworldeuropeafricausajapan
馃摜聽makevalid9457鈥疜B
馃摜聽s3_twkb_p3921鈥疜B
馃摜聽s4_twkb_p31249鈥疜B
馃摜聽s5_twkb_p31441鈥疜B
馃摜聽s6_twkb_p31810鈥疜B
馃摜聽s7_twkb_p32146鈥疜B
馃摜聽s8_twkb_p32158鈥疜B
馃摜聽s3_wkb3002鈥疜B
馃摜聽s4_wkb4997鈥疜B
馃摜聽s5_wkb5984鈥疜B
馃摜聽s6_wkb8462鈥疜B
馃摜聽s7_wkb9179鈥疜B
馃摜聽s8_wkb9297鈥疜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.

VariantSizeworldberlinnyctokyoljubljana
馃摜聽makevalid48156鈥疜B
馃摜聽s3_twkb_p35599鈥疜B
馃摜聽s4_twkb_p33788鈥疜B
馃摜聽s5_twkb_p34333鈥疜B
馃摜聽s6_twkb_p36119鈥疜B
馃摜聽s7_twkb_p36131鈥疜B
馃摜聽s8_twkb_p36127鈥疜B
馃摜聽s3_wkb30052鈥疜B
馃摜聽s4_wkb18726鈥疜B
馃摜聽s5_wkb21704鈥疜B
馃摜聽s6_wkb34611鈥疜B
馃摜聽s7_wkb34639鈥疜B
馃摜聽s8_wkb34643鈥疜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.

VariantSizeworldeuropeafricausajapan
馃摜聽makevalid157384鈥疜B
馃摜聽s3_twkb_p311522鈥疜B
馃摜聽s4_twkb_p314368鈥疜B
馃摜聽s5_twkb_p317473鈥疜B
馃摜聽s6_twkb_p318358鈥疜B
馃摜聽s7_twkb_p320705鈥疜B
馃摜聽s8_twkb_p328446鈥疜B
馃摜聽s3_wkb29437鈥疜B
馃摜聽s4_wkb49922鈥疜B
馃摜聽s5_wkb67690鈥疜B
馃摜聽s6_wkb72953鈥疜B
馃摜聽s7_wkb89964鈥疜B
馃摜聽s8_wkb135143鈥疜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.

VariantSizeworldeuropeafricausajapan
馃摜聽makevalid266186鈥疜B
馃摜聽s3_twkb_p342856鈥疜B
馃摜聽s4_twkb_p315691鈥疜B
馃摜聽s5_twkb_p316420鈥疜B
馃摜聽s6_twkb_p325751鈥疜B
馃摜聽s7_twkb_p337814鈥疜B
馃摜聽s8_twkb_p344625鈥疜B
馃摜聽s3_wkb232214鈥疜B
馃摜聽s4_wkb54140鈥疜B
馃摜聽s5_wkb52469鈥疜B
馃摜聽s6_wkb128806鈥疜B
馃摜聽s7_wkb208105鈥疜B
馃摜聽s8_wkb246050鈥疜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.

Acknowledgements