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

Add tags to community CSVs, add new script to generate tags, and update existing scripts to reflect tag support #125

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

cstephen
Copy link
Contributor

This PR:

  • Adds a new "tags" column to all point location CSVs. These tags are used in conjunction with this Data-API PR Add filter-by-tag support to community endpoints data-api#497 to allow us to decide which communities should show up as selectable places in which webapps. Our initial reason for doing this was to add additional Alaska military locations to Arctic-EDS without them also appearing in Northern Climate Reports or ARDAC Explorer. This will also make it easy to add circumpolar locations to ARDAC Explorer without them also appearing in Northern Climate Reports or Arctic-EDS (to be tackled soon as a separate PR).
  • Adds a new tag_point_locations.py script that reads in existing point location CSV files from vector_data/point and determines how they should be tagged. It writes the freshly-tagged CSVs out to a .gitignore'ed subdirectory, utilities/tagged_csvs.
  • Adds tag support to the add_point_location.py script.
  • Moves the IEM polygon check out of create_updated_ncr_shapefiles.py and into the new tag_point_locations.py script. Now, only communities within Alaska, British Columbia, and Yukon that fall within the IEM polygon are tagged with the ncr tag, and only communities tagged with ncr will be selectable from NCR. So, this solves the same problem in a different but more flexible way. I've also renamed create_updated_ncr_shapefiles.py to create_shapefiles.py since the shapefiles created by this script are used for all of our webapps.

These changes affect only point locations currently, but in the future we may want to consider tagging polygons also. Something to consider another time / in another PR.

To test, run the tag_point_locations.py script and confirm that the CSV outputs in the utilities/tagged_csvs subdirectory match the ones in vector_data/point, and spot check the rows of each CSV file to make sure the chosen tags make sense. Also, try running the modified create_shapefiles.py script and spot check the shapefile outputs for sanity.

@cstephen cstephen requested a review from charparr December 13, 2024 22:30
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.

1 participant