Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regions #3

Closed
bhousel opened this issue Nov 1, 2019 · 3 comments
Closed

Regions #3

bhousel opened this issue Nov 1, 2019 · 3 comments
Assignees
Milestone

Comments

@bhousel
Copy link
Collaborator

bhousel commented Nov 1, 2019

I'd like to be able to also get regions, which would sit at a level higher than countries.
Each country could belong to a single region, and there could be a lookup table or something.

There are many ways to slice up the world, but I'm thinking these 12 (+ Antarctica) would give us a bunch of flexibility:

  • North America
  • Central America
  • South America
  • Western Europe
  • Eastern Europe
  • Middle East
  • North Africa
  • Sub-Saharan Africa
  • Central and South Asia
  • Southeast Asia
  • East Asia
  • Oceania
  • Antarctica
@quincylvania
Copy link
Contributor

@bhousel I discovered the UN M49 list which seems like a workable standard to support. It's a superset of ISO 3166-1 numeric-3 codes with a bunch of regions, including most of those you listed.

https://en.wikipedia.org/wiki/UN_M49
https://unstats.un.org/unsd/methodology/m49/

@quincylvania quincylvania self-assigned this Nov 4, 2019
@bhousel
Copy link
Collaborator Author

bhousel commented Nov 4, 2019

@bhousel I discovered the UN M49 list which seems like a workable standard to support. It's a superset of ISO 3166-1 numeric-3 codes with a bunch of regions, including most of those you listed.

whoa good find, that looks perfect! 👍

@quincylvania quincylvania added this to the 1.1.0 milestone Nov 4, 2019
@quincylvania
Copy link
Contributor

So I integrated the M49 list. I'm not totally sure how you want to work with this data but right now you can use the features endpoint like this:

const coder = new CountryCoder();
coder.features([-12.3, -37.1]));

The returned array will include the region features, then you can check the m49 property of each one to see if a particular point is in your region of interest.

This is sorta clunky so we should add endpoints for "give me all the features in the region with this code" and "is this point in the region with this code".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants