Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

place

Nearest country and municipality, from Natural Earth countries and, optionally, Eurostat GISCO LAU municipalities.

geoenrich place <INPUT> --countries <NE> [--municipalities <GISCO>] [OPTIONS]

Appends three columns:

ColumnMeaning
countryCountry name
country_codeISO alpha-3 code (the Natural Earth -99 placeholder becomes null)
municipalityMunicipality name (empty unless --municipalities is given)

How it works

Both the country and the municipality lookups resolve a point by containment first (an even-odd point-in-polygon test over R-tree candidates) and fall back to the nearest boundary otherwise, so an offshore point still gets the closest land unit. Attribute fields are auto-detected from candidate name lists, so minor schema drift between dataset versions needs no flags.

--municipalities is optional: without it the municipality column is left empty and a note says so.

Options

Beyond the shared options and the region options:

OptionDefaultMeaning
--countries <PATH>requiredNatural Earth countries shapefile
--municipalities <PATH>noneGISCO LAU municipalities shapefile

Example

geoenrich place cores.parquet \
  --countries ./data/naturalearth/ne_10m_admin_0_countries.shp \
  --municipalities ./data/gisco/lau.shp

See Reference datasets for how to obtain Natural Earth and GISCO.