Skip to content

Latest commit

 

History

History
241 lines (175 loc) · 10.6 KB

README.tmpl.md

File metadata and controls

241 lines (175 loc) · 10.6 KB

Logo

tinygpkg-data

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

Report Bug · Request 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

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.

{{define "featured" -}} {{$n := .Name -}} {{$s := .Source -}} {{$d := .Desc -}} | [📥 {{$n}}]({{ gpkg $n | download }}) | {{ $d }} | {{ $n | gpkg | local | filesize | kb }}
{{ percent ($n | gpkg | local | filesize) (local $s | filesize) }} of {{ local $s | filesize | kb }} | {{ $n | gpkg | local | gzipfilesize | kb }}
{{ percent ($n | gpkg | local | gzipfilesize) (local $s | gzipfilesize) }} of {{ local $s | gzipfilesize | kb }} | {{- end -}}

File Description Size (vs. source) Gzipped size (vs. source)
Tiny (TWKB)
{{ template "featured" featured "ne_110m_admin_0_countries_s5_twkb_p3" "ne_110m_admin_0_countries.geojson" "117 country borders" }}
{{ template "featured" featured "ne_10m_admin_0_countries_s4_twkb_p3" "ne_10m_admin_0_countries.geojson" "258 country borders" }}
{{ template "featured" featured "ne_10m_urban_areas_landscan_s5_twkb_p3" "ne_10m_urban_areas_landscan.geojson" "6018 city borders" }}
{{ template "featured" featured "geoBoundariesCGAZ_ADM2_s5_twkb_p3" "geoBoundariesCGAZ_ADM2.gpkg" "49689 city borders" }}
Compatible (WKB)
{{ template "featured" featured "ne_110m_admin_0_countries_s5_wkb" "ne_110m_admin_0_countries.geojson" "117 country borders" }}
{{ template "featured" featured "ne_10m_admin_0_countries_s4_wkb" "ne_10m_admin_0_countries.geojson" "258 country borders" }}
{{ template "featured" featured "ne_10m_urban_areas_landscan_s5_wkb" "ne_10m_urban_areas_landscan.geojson" "6018 city borders" }}
{{ template "featured" featured "geoBoundariesCGAZ_ADM2_s5_wkb" "geoBoundariesCGAZ_ADM2.gpkg" "49689 city borders" }}

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.

{{define "variants" -}} {{range .}}{{$variant := .}}| [📥 {{.Name}}]({{ .Fullname | gpkg | download }}) | {{ .Fullname | gpkg | local | filesize | kb }} | {{range .Previews}} | {{end}} {{end -}} {{end -}}

{{define "header" -}} | Variant | Size | {{range .}} {{.}} | {{end}} | --- | --- | {{range .}} --- | {{end -}} {{end -}}

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.

{{template "header" .LargePlaces}} {{ $name := "ne_110m_admin_0_countries" -}} {{template "variants" variants $name "_makevalid" .LargePlaces "" -}} {{template "variants" variants $name "_s?twkb_p?" .LargePlaces "roundtrip" -}} {{template "variants" variants $name "_s?_wkb" .LargePlaces ""}}

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.

{{template "header" .LargePlaces}} {{ $name := "ne_10m_admin_0_countries" -}} {{template "variants" variants $name "_makevalid" .LargePlaces "" -}} {{template "variants" variants $name "_s?twkb_p?" .LargePlaces "roundtrip" -}} {{template "variants" variants $name "_s?_wkb" .LargePlaces ""}}

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.

{{template "header" .SmallPlaces}} {{ $name := "ne_10m_urban_areas_landscan" -}} {{template "variants" variants $name "_makevalid" .SmallPlaces "" -}} {{template "variants" variants $name "_s?twkb_p?" .SmallPlaces "roundtrip" -}} {{template "variants" variants $name "_s?_wkb" .SmallPlaces ""}}

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.

{{template "header" .LargePlaces}} {{ $name := "geoBoundariesCGAZ_ADM0" -}} {{template "variants" variants $name "_makevalid" .LargePlaces "" -}} {{template "variants" variants $name "_s?twkb_p?" .LargePlaces "roundtrip" -}} {{template "variants" variants $name "_s?_wkb" .LargePlaces ""}}

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.

{{template "header" .LargePlaces}} {{ $name := "geoBoundariesCGAZ_ADM2" -}} {{template "variants" variants $name "_makevalid" .LargePlaces "" -}} {{template "variants" variants $name "_s?twkb_p?" .LargePlaces "roundtrip" -}} {{template "variants" variants $name "_s?_wkb" .LargePlaces ""}}

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