12rambau / pygadm

Easy access to administrative boundary defined by GADM from Python scripts
https://pygadm.readthedocs.io
MIT License
7 stars 1 forks source link

Unable to load Items by name #68

Closed leoduret closed 4 months ago

leoduret commented 4 months ago

Describe the bug

Names returns the right admin code but no geometries are returned using Items

To Reproduce

Pass United States, South Africa by name to Items no geometries are returned. Will return geometries only by admin so USA and ZAF

Screenshots image

leoduret commented 4 months ago

Full list:

patchwork = {
  "Pakistan": "PAK",
  "India": "IND",
  "China": "CHN",
  "United States": "USA",
  "South Africa": "ZAF",
  "Saudi Arabia": "SAU",
  "Democratic republic of the congo": "COD",
  "United Kingdom": "GBR",
  "New Zealand": "NZL",
  "Papua New Guinea": "PNG",
  "Mexico": "MEX",
  "Costa Rica": "CRI",
  "Dominican Republic": "DOM",
  "Sierra Leone": "SLE",
  "Côte d'Ivoire": "CIV",
  "Burkina Faso": "BFA",
  "Equatorial Guinea": "GNQ",
  "Central African Republic": "CAF",
  "South Sudan": "SSD",
  "Republic of the Congo": "COG",
  "South Korea": "KOR",
}

items = Items(name=df.loc[~df["Country"].isin(set(patchwork.keys())), "Country"].to_list(), content_level=0)
gdf = pd.concat([items, *(Items(admin=adm) for adm in patchwork.values())])
12rambau commented 4 months ago
12rambau commented 4 months ago

I think the PR will close this issue. The remaining ones are conflicting as the name exist in multiple places on the planet. let's use another issue to add this feature.