mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-21 01:43:51 +01:00
* T006: read GeoNames ZIPs with craft-zip * geocode: take craft-zip at the workspace's craft-libs rev; build the fixture with its writer craft-zip at 23acc704, the rev every other craft-libs crate here uses, has the same Archive and Writer code as 5c496f6e (that rev only adds the seekable reader), so the workspace stays on one craft-libs rev. unzip::make now builds its one-file fixture with craft_zip::Writer instead of hand-written headers, so geocode no longer needs crc32fast or miniz_oxide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * geocode: retain the selected ZIP entry index --------- Co-authored-by: FredApps <FredApps@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
lightcraft-geocode (L1)
Offline reverse geocoding: a GPS position becomes Sublocation / City / State / Country.
- Data: the GeoNames dump (https://download.geonames.org/export/dump/), licensed CC-BY 4.0
(attribution: "GeoNames, geonames.org"). Nothing is bundled: the engine
(
metadata.downloadPlaceNames) downloadscities15000.zip,admin1CodesASCII.txtandcountryInfo.txton the user's request into the settings folder. This crate only parses and searches; it never touches the network. - Lookup: the nearest populated place within
MAX_KM(great-circle distance), searched in the 1° cells around the position, so one lookup looks at a few dozen places, not all of them. - unzip: just enough ZIP to read one file out of
cities15000.zip(stored or deflated). - Never panics on hostile input: bad lines are skipped, NaN / out-of-range positions find nothing, sizes and counts are capped.
Sources: GeoNames dump readme (file layout, prose); haversine distance (textbook); PKWARE APPNOTE (ZIP, prose spec); the cell index is own design.