Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ceqr_dep_monthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
python3 -m pip install mdpdf
./ceqr run recipe dep_cats_permits

- name: library archive
run: dcpy lifecycle scripts ingest_or_library_archive dep_cats_permits --latest --version "$(date '+%Y-%m-%d')" --push-to-s3

- name: Create issue on success
if: success()
uses: JasonEtco/create-an-issue@v2
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ingest_arcgis_feature_server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ jobs:
nysdec_priority_shorelines
nysdec_priority_estuaries
nysdec_priority_streams
nysdec_state_facility_permits
nysdec_tidal_wetlands
nysdec_title_v_facility_permits
nysparks_historicplaces
nysparks_parks
nysshpo_historic_buildings_points
Expand Down
2 changes: 1 addition & 1 deletion dcpy/library/templates/dep_cats_permits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dataset:
# uid: f4rp-2kvy
# format: csv
url:
path: https://nyc3.digitaloceanspaces.com/edm-publishing/ceqr-app-data/dep_cats_permits/{{ version }}/dep_cats_permits.csv
path: https://nyc3.digitaloceanspaces.com/edm-publishing/datasets/dep_cats_permits/{{ version }}/dep_cats_permits.csv
options:
- "AUTODETECT_TYPE=NO"
- "EMPTY_STRING_AS_NULL=YES"
Expand Down
41 changes: 0 additions & 41 deletions dcpy/library/templates/nysdec_state_facility_permits.yml

This file was deleted.

41 changes: 0 additions & 41 deletions dcpy/library/templates/nysdec_title_v_facility_permits.yml

This file was deleted.

21 changes: 21 additions & 0 deletions ingest_templates/nysdec_state_facility_permits.yml
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 }
21 changes: 21 additions & 0 deletions ingest_templates/nysdec_title_v_facility_permits.yml
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 }
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ VERSION=$DATE
cd $BASEDIR
mkdir -p output

docker run --rm\
-e EDM_DATA=$EDM_DATA\
-v $(pwd)/../:/recipes\
-e NAME=$NAME\
-w /recipes/$NAME\
nycplanning/docker-geosupport:latest python3 build.py
python3 build.py
(
cd output

Expand All @@ -37,4 +32,4 @@ VERSION=$DATE
Upload $NAME $VERSION
Upload $NAME latest
rm -rf output
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ VERSION=$DATE
cd $BASEDIR
mkdir -p output

docker run --rm\
-v $(pwd)/../:/recipes\
-e NAME=$NAME\
-w /recipes/$NAME\
nycplanning/docker-geosupport:latest python3 build.py |
python3 build.py |
psql $EDM_DATA --set ON_ERROR_STOP=1 -v NAME=$NAME -v VERSION=$VERSION -f create.sql

(
Expand All @@ -39,4 +35,4 @@ VERSION=$DATE
Upload $NAME latest
rm -rf output

)
)
6 changes: 2 additions & 4 deletions products/green_fast_track/models/_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ sources:

- name: nysdec_title_v_facility_permits
columns:
- name: permit_id
- name: dec_id
tests:
- unique
- not_null
- name: facility_name
tests:
Expand All @@ -162,9 +161,8 @@ sources:

- name: nysdec_state_facility_permits
columns:
- name: permit_id
- name: dec_id
tests:
- unique
- not_null
- name: facility_name
tests:
Expand Down
Copy link
Contributor Author

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

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
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
Loading