-
Notifications
You must be signed in to change notification settings - Fork 3
migrate nysdec permits to pull from source #2140
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
57d9f52
add nysdec facilities ingest templates
fvankrieken f12e163
to-drop - run nysdec permits
fvankrieken 3a10614
Revert "to-drop - run nysdec permits"
fvankrieken 13c5786
get runner working for nysdec permits
fvankrieken 393c6b5
load nysdec from both old source and agol
fvankrieken 96a5de9
update permit library source paths
fvankrieken 180ad37
operationalize agol source for nysdec permits
fvankrieken ac54666
library archive dep_cats_permits during monthly run
fvankrieken 5ea8dd0
update gft to reflect source data schema change
fvankrieken 4a5e081
deduplicate nysdec permit records
fvankrieken dea69cd
update pilot projects
fvankrieken File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
dcpy/library/templates/nysdec_title_v_facility_permits.yml
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| id: nysdec_state_facility_permits | ||
| acl: public-read | ||
|
|
||
| attributes: | ||
| name: NYSDEC State Facility Permits | ||
| description: >- | ||
| State Facility Permits are issued to facilities considered to be mid-sized. They | ||
| have lower potential emissions, fewer permit requirements than Title V facilities, | ||
| and they meet the criteria of Subpart 201-5. | ||
| url: https://www.arcgis.com/home/item.html?id=a29c5e334de14f63884ebe4855345f41 | ||
|
|
||
| ingestion: | ||
| source: | ||
| type: arcgis_feature_server | ||
| server: nys_clearinghouse | ||
| dataset: Air_State_Facility_Permits_ASF | ||
| file_format: | ||
| type: geojson | ||
| processing_steps: | ||
| - name: clean_column_names | ||
| args: { "replace": { " ": "_" }, "lower": True } |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| id: nysdec_title_v_facility_permits | ||
| acl: public-read | ||
|
|
||
| attributes: | ||
| name: NYSDEC Title V Facility Permits | ||
| description: >- | ||
| Title V Permits are issued to facilities that are major sources of air emissions. | ||
| These facilities are usually considered to be the largest in the state and meet the | ||
| criteria of Subpart 201-6. | ||
| url: https://www.arcgis.com/home/item.html?id=4f1f53ba97934e1cafaf68a11f7c489f | ||
|
|
||
| ingestion: | ||
| source: | ||
| type: arcgis_feature_server | ||
| server: nys_clearinghouse | ||
| dataset: Air_Title_V_Permits_ATV | ||
| file_format: | ||
| type: geojson | ||
| processing_steps: | ||
| - name: clean_column_names | ||
| args: { "replace": { " ": "_" }, "lower": True } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
16 changes: 10 additions & 6 deletions
16
products/green_fast_track/models/staging/stg__nysdec_state_facility_permits.sql
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,19 @@ | ||
| WITH source AS ( | ||
| SELECT * | ||
| FROM {{ source('recipe_sources', 'nysdec_state_facility_permits') }} | ||
| SELECT * FROM {{ source('recipe_sources', 'nysdec_state_facility_permits') }} | ||
| ), | ||
| deduplicated AS ( | ||
| SELECT DISTINCT | ||
| dec_id, | ||
| facility_name, | ||
| geom | ||
| FROM source | ||
| ), | ||
|
|
||
| final AS ( | ||
| SELECT | ||
| 'state_facility_permits' AS variable_type, | ||
| permit_id AS variable_id, | ||
| dec_id AS variable_id, | ||
| facility_name, | ||
| ST_TRANSFORM(geom::geometry, 2263) AS permit_geom | ||
| FROM source | ||
| FROM deduplicated | ||
| ) | ||
|
|
||
| SELECT * FROM final |
18 changes: 12 additions & 6 deletions
18
products/green_fast_track/models/staging/stg__nysdec_title_v_facility_permits.sql
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,20 @@ | ||
| WITH source AS ( | ||
| SELECT * | ||
| FROM {{ source('recipe_sources', 'nysdec_title_v_facility_permits') }} | ||
| SELECT * FROM {{ source('recipe_sources', 'nysdec_title_v_facility_permits') }} | ||
| ), | ||
| deduplicated AS ( | ||
| SELECT DISTINCT | ||
| dec_id, | ||
| facility_name, | ||
| year, | ||
| siccode, | ||
| geom | ||
| FROM source | ||
| ), | ||
|
|
||
| final AS ( | ||
| SELECT | ||
| 'title_v_permits' AS variable_type, | ||
| permit_id AS variable_id, | ||
| dec_id AS variable_id, | ||
| st_transform(geom::geometry, 2263) AS permit_geom | ||
| FROM source | ||
| FROM deduplicated | ||
| ) | ||
|
|
||
| SELECT * FROM final |
Oops, something went wrong.
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.
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.
The new ones seem to have duplicate rows when there are multiple urls to view. 7 total cases across the two datasets