rapomon / geojson-places

Reverse geocoding to determine the location where it is contained (continent, country, region and state) from the latitude and longitude specified. This module also has tools to get lists of continents, country groupings, countries, regions and states in the specified language.
ISC License
55 stars 13 forks source link

Ivory Coast region codes aren't ISO-3166-2 compliant #6

Open Portur opened 1 year ago

Portur commented 1 year ago

Hi, It seems the region codes for Ivory Coast aren't compliant with the ISO-3166 syntax.

The expectation is to have a syntax like CI-XX but the result is like CI-XX-XX.

Usage

const geojsonPlaces = require("geojson-places");
geojsonPlaces.getRegionsByCountryAlpha2('CI');

Result (only invalids)

[
  {
    "country_a2": "CI",
    "region_code": "CI-CM-SC",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-MN-CV",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-BS-SO",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-SB-LA",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-LG-AB",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-SM-HS",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-AG-AV",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-NC-BG",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-MR-ZU",
    "region_name": "Ivory Coast"
  },
  {
    "country_a2": "CI",
    "region_code": "CI-LC-TM",
    "region_name": "Ivory Coast"
  },
]