# Where TravelClip's place knowledge comes from (and how fresh it is)

## Sources (kept in travelbrain/sources, read on every rebuild)
- **GeoNames — South Africa** (geonames.org, CC BY 4.0, downloaded 16 Nov 2026): every town, suburb, locality, area, region, district, local municipality, park and reserve in South Africa, with coordinates, population and alternative names. Credit: "Place data © GeoNames (geonames.org), CC BY 4.0".
- **OurAirports** (ourairports.com, public domain, downloaded 16 Nov 2026): every airport in the world with IATA, ICAO and coordinates.
- **OpenStreetMap** (© OpenStreetMap contributors, ODbL, downloaded 16 Nov 2026): wine farms and wine cellars, national parks and nature reserves in South Africa. Not every farm is mapped — treat the lists as a strong guide, not complete.
- **Our own code library** (Library → Codes & places): the exact airport, hotel city, car branch and coach stop codes our suppliers use for searches. When a code here differs from the open data, OUR library is what the booking forms accept.

## How "nearest airport" is worked out
- For every South African place the system measures the straight-line distance to every South African airport that has scheduled flights, and names the nearest one (and a closer small airfield with an IATA code, if there is one).
- Straight-line distance, not driving distance — mountains and roads can make a slightly further airport the better choice (e.g. some Garden Route towns are easier from GRJ than PBZ; Kruger lodges may fly into MQP, HDS, SZK or PHW depending on the gate).
- For "which code covers a city", see the "Towns and areas near … airport" pieces: every town for which that airport is the nearest scheduled one, within 60 km and 60–250 km.

## Refreshing the data
- GeoNames and OurAirports change slowly; refresh every few months by downloading again into travelbrain/sources (same file names).
- OpenStreetMap: re-run the Overpass query for South African wineries, wine cellars, national parks and nature reserves into osm-za.json.
- TravelClip rebuilds its memory automatically when any of these files changes.

## Not used
- Mapbox: its standard terms do not allow keeping search results, so it is not used for TravelClip's memory. It may be used later for live maps on the sites (needs the owner's Mapbox account and token).
