Expand description
GeoNames database access helpers.
Constants§
- GEONAMES_
SCHEMA_ VERSION - Schema version stamp. Bump whenever the column layout changes so
geonames_schema_is_currentcan detect a stale on-disk DB and trigger a rebuild. v2: addedfeature_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
truewhen 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.