passport icon indicating copy to clipboard operation
passport copied to clipboard

add administrative division support

Open alistaire47 opened this issue 6 years ago • 0 comments

It would be nice to add administrative division support, including names in as many languages as possible (start with UN-official?) and codes where possible (at least ISO 3166-2), in parallel with as_country_code, as_country_name, and parse_country, maybe with as_division_code etc. ("state" is country-specific). parse_division (or whatever it's called) should probably take a country parameter to limit result scope.

Code can be recycled and refactored to be multi-purpose, but new data will have to be assembled. ISO 3166-2 codes are easy enough to grab, but I don't think CLDR yet has administrative divisions, so non-English names may be hard.

Going beyond principal subdivisions (e.g. not just U.S. states, but down to counties/parishes) seems unlikely unless a spectacular data source appears. AFAIK most (all?) codes for them are country-specific (e.g. FIPS), so aggregating data would be a pain. Machine translation of names is possible, if it's useful.

  • [ ] Aggregate data
  • [ ] Build conversion functions
  • [ ] Build parsing function
  • [ ] Add way to mutate from division to country without geocoding
  • [ ] Build attribute function (capitals, at least)

alistaire47 avatar Jul 12 '17 20:07 alistaire47