Skip to main content

Module geonames

Module geonames 

Source
Expand description

GeoNames database access helpers.

Constants§

GEONAMES_SCHEMA_VERSION
Schema version stamp. Bump whenever the column layout changes so geonames_schema_is_current can detect a stale on-disk DB and trigger a rebuild. v2: added feature_code (PPLC / PPLA / PPLA2 / PPL / …). Lets us prefer real cities over GeoNames “PPL” entries that inherit a metro-wide population — e.g. Rasapudipalem (PPL, pop 1,728,128 in upstream data) shouldn’t outrank Visakhapatnam (PPLA2, pop 1,063,178).

Functions§

build_geonames_db
geonames_db_exists
Check if bundled GeoNames DB exists.
geonames_db_is_current
Validate a specific GeoNames database without creating or mutating it.
geonames_db_path
Resolve GeoNames DB path.
geonames_schema_is_current
Returns true when the on-disk geonames.db matches the current schema. False if the file is missing OR built against an older layout. Callers (asset setup, the geocoder) should rebuild when this returns false.