-
Notifications
You must be signed in to change notification settings - Fork 3
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
Populate National Utilities #215
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rajadain
force-pushed
the
tt/import-utilities
branch
from
November 27, 2022 23:06
a38dd15
to
38c636e
Compare
Rebased on latest |
Taking a look |
caseycesari
approved these changes
Nov 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be used like: ./scripts/fetch-data --utilities The utility IDs start with 3, so should work with the two test utilities in development, as well as in other environmnents where those test utilities are absent.
Since now there will be ~45K utilities in the system, we improve the utility admin to have search and filter capabilities to be a little more manageable.
Now that we have live utilities, instead of always initializing the map on the same North Carolina spot, we initialize it where the selected utility's centroid is, falling back to the old default if necessary.
This was not used in the UI.
rajadain
force-pushed
the
tt/import-utilities
branch
from
November 28, 2022 16:49
38c636e
to
7e88f58
Compare
Thanks for reviewing! Rebased above latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
The clients gave us a list of utilities to import. This is a national list, contains ~45K+ entries. This geojson file is here: https://drive.google.com/file/d/1iZT0ilvkVafIjMMRIasXEr0zeRH6ZKLl/view?usp=share_link.
Since our data model is different, I used jq to massage the geojson into something that matches our structure:
The above also filters out utilities that don't have a location, and those that do not belong to the 50 official states.
Then I imported that geojson into my local database:
I then edited the
docker-compose.override.yml
file to allow access into the database container:Then I went inside and
pg_dump
ed the table out:I manually removed the first two rows containing development / test utilities. Then I uploaded the file to a new S3 bucket:
I then
scp
d the file to staging and production and ran it there:Also makes it so that the map initializes at the selected utility's location, rather than always in North Carolina.
Closes #196
Demo
2022-11-21.18.49.42.mp4
Testing Instructions
server
a1@azavea.com
/password
Checklist
fixup!
commits have been squashedCHANGELOG.md
updated with summary of features or fixes, following Keep a Changelog guidelinesREADME.md
updated if necessary to reflect the changes