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

Country coder #298

Merged
merged 35 commits into from
Nov 18, 2019
Merged

Country coder #298

merged 35 commits into from
Nov 18, 2019

Conversation

bhousel
Copy link
Member

@bhousel bhousel commented Nov 17, 2019

closes #291

I've been working on this for a few days - this removes a lot of the .geojson files and instead leverages country-coder, iD's new dataset for world region and country boundaries.

This is a breaking change but it lets us significantly reduce the footprint of this library. Every .geojson file for a country or larger region (like Africa, or Latam) can go away. I'm also supporting point locations and we can calculate the 25km circular buffer around them (so all those YouthMappers geometries can go away too).

The main difference is replacing the featureId property with includeLocations and excludeLocations properties to better define where resources are active.

Before:
  • featureId - (optional) A unique identifier for the feature. This featureId matches the resource to a .geojson feature. If null, this is a global resource.
After:
  • includeLocations - (required) Array of locations where the resource is active. May contain any of these:
  • excludeLocations - (optional) Array of locations to exclude from includeLocations (specified in the same format):

I'd still like to add some more convenience functions for downstream use, and tests for that. But it's coming along really well.

Before:

Screenshot 2019-11-16 22 56 18

After (I can shrink combined a bunch still):

Screenshot 2019-11-16 22 55 56

This lets us refer to them in `includeLocations`/`excludeLocations` by their filename
Also sort all the files so the keys and array values are consistent
(they didn't get rolled into the previous updates because they weren't
using the circular geojson geometries)
This snaps it to the points that country-coder uses for the UK boundary
(re: #297)
Also removes some geojson files that were like this.
- `isValidLocation` returns quickly
- `locationToFeature`
  - actually generates point buffers for point locations
  - uses countrycoder.aggregrateFeature to get full geometry
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

Successfully merging this pull request may close these issues.

Depend on country-coder
1 participant