https://github.com/plausible/location
Elixir package for translating names of ISO3166-1, ISO3166-2 and geoname IDs
https://github.com/plausible/location
Last synced: 4 months ago
JSON representation
Elixir package for translating names of ISO3166-1, ISO3166-2 and geoname IDs
- Host: GitHub
- URL: https://github.com/plausible/location
- Owner: plausible
- License: mit
- Created: 2021-12-09T08:36:38.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T10:46:02.000Z (over 1 year ago)
- Last Synced: 2025-04-23T16:52:28.890Z (about 1 year ago)
- Language: Elixir
- Homepage:
- Size: 1.86 MB
- Stars: 14
- Watchers: 8
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Location
Elixir library for accessing ISO3166-1 (country) and ISO3166-2 (subdivision) data as well as geoname data for cities. Source data comes from the upstream [debian iso-codes](https://salsa.debian.org/iso-codes-team/iso-codes) package and the [Geonames](http://www.geonames.org/) project.
### Countries
The data for countries comes primarily from the [debian iso-codes](https://salsa.debian.org/iso-codes-team/iso-codes) package. The data file for that is stored in `priv/iso_3166-1.json`. We do
manually add some data that is missing from upstream. Overrides can be found in `priv/override/iso_3166-1.json`
### Subdivisions
The data for subdivisions comes primarily from the [debian iso-codes](https://salsa.debian.org/iso-codes-team/iso-codes) package. The data file for that is stored in `priv/iso_3166-2.json`. The subdivision names in this file are mostly in local language (i.e. Wien instead of Vienna). English translations are obtained from CLDR and Wikipedia. The translations found in `priv/iso_3166-2.en-translations.json` are used when available instead of the original name.
### Cities
The data for cities comes from the [geonames](http://www.geonames.org/) project. This project has scripts to download the main `allCountries.txt` file. It is then processed to make it smaller
(from 1.3GB to about 130MB). Still, the resulting file is quite large so we also provide a city database based on the smaller `cities500.txt` file.