diff --git a/products/cscl/models/product/cdta2020/cdta2020_by_field.sql b/products/cscl/models/product/cdta2020/cdta2020_by_field.sql new file mode 100644 index 0000000000..ec559fb523 --- /dev/null +++ b/products/cscl/models/product/cdta2020/cdta2020_by_field.sql @@ -0,0 +1,4 @@ +SELECT + {{ apply_text_formatting_from_seed('text_formatting__cdta2020_dat') }} +FROM {{ source('recipe_sources', 'dcp_cscl_cdtaequiv2020') }} +ORDER BY cdta_code diff --git a/products/cscl/models/product/cdta2020/cdta2020_by_field_csv.sql b/products/cscl/models/product/cdta2020/cdta2020_by_field_csv.sql new file mode 100644 index 0000000000..0d5a679ba6 --- /dev/null +++ b/products/cscl/models/product/cdta2020/cdta2020_by_field_csv.sql @@ -0,0 +1,4 @@ +SELECT + {{ apply_text_formatting_from_seed('text_formatting__cdta2020_csv') }} +FROM {{ source('recipe_sources', 'dcp_cscl_cdtaequiv2020') }} +ORDER BY cdta_code diff --git a/products/cscl/models/product/cdta2020/cdta2020_csv.sql b/products/cscl/models/product/cdta2020/cdta2020_csv.sql new file mode 100644 index 0000000000..f329264387 --- /dev/null +++ b/products/cscl/models/product/cdta2020/cdta2020_csv.sql @@ -0,0 +1,6 @@ +SELECT + cdta_code AS "CDTA_CODE", + cdta_name AS "CDTA_NAME", + cdta_type AS "CDTA_TYPE" +FROM {{ ref('cdta2020_by_field_csv') }} +ORDER BY cdta_code diff --git a/products/cscl/models/product/cdta2020/cdta2020_dat.sql b/products/cscl/models/product/cdta2020/cdta2020_dat.sql new file mode 100644 index 0000000000..877766fe1e --- /dev/null +++ b/products/cscl/models/product/cdta2020/cdta2020_dat.sql @@ -0,0 +1 @@ +{{ select_rows_as_text(model='cdta2020_by_field') }} diff --git a/products/cscl/models/product/nta2020/nta2020_by_field.sql b/products/cscl/models/product/nta2020/nta2020_by_field.sql new file mode 100644 index 0000000000..7eed1e75a6 --- /dev/null +++ b/products/cscl/models/product/nta2020/nta2020_by_field.sql @@ -0,0 +1,4 @@ +SELECT + {{ apply_text_formatting_from_seed('text_formatting__nta2020_dat') }} +FROM {{ source('recipe_sources', 'dcp_cscl_ntaequiv2020') }} +ORDER BY nta_code diff --git a/products/cscl/models/product/nta2020/nta2020_by_field_csv.sql b/products/cscl/models/product/nta2020/nta2020_by_field_csv.sql new file mode 100644 index 0000000000..52943df5a4 --- /dev/null +++ b/products/cscl/models/product/nta2020/nta2020_by_field_csv.sql @@ -0,0 +1,4 @@ +SELECT + {{ apply_text_formatting_from_seed('text_formatting__nta2020_csv') }} +FROM {{ source('recipe_sources', 'dcp_cscl_ntaequiv2020') }} +ORDER BY nta_code diff --git a/products/cscl/models/product/nta2020/nta2020_csv.sql b/products/cscl/models/product/nta2020/nta2020_csv.sql new file mode 100644 index 0000000000..282e9a1c33 --- /dev/null +++ b/products/cscl/models/product/nta2020/nta2020_csv.sql @@ -0,0 +1,7 @@ +SELECT + nta_code AS "NTA_CODE", + nta_name AS "NTA_NAME", + nta_abbrev AS "NTA_ABBREV", + nta_type AS "NTA_TYPE" +FROM {{ ref('nta2020_by_field_csv') }} +ORDER BY nta_code diff --git a/products/cscl/models/product/nta2020/nta2020_dat.sql b/products/cscl/models/product/nta2020/nta2020_dat.sql new file mode 100644 index 0000000000..3e75d449e7 --- /dev/null +++ b/products/cscl/models/product/nta2020/nta2020_dat.sql @@ -0,0 +1 @@ +{{ select_rows_as_text(model='nta2020_by_field') }} diff --git a/products/cscl/models/sources.yml b/products/cscl/models/sources.yml index 03987b9c2b..9202eb1663 100644 --- a/products/cscl/models/sources.yml +++ b/products/cscl/models/sources.yml @@ -26,6 +26,10 @@ sources: - name: dcp_cscl_nypdbeat - name: dcp_cscl_censustract2010 - name: dcp_cscl_censustract2020 + - name: dcp_cscl_cdta2020 + - name: dcp_cscl_cdtaequiv2020 + - name: dcp_cscl_nta2020 + - name: dcp_cscl_ntaequiv2020 - name: dcp_cscl_firecompany - name: dcp_cscl_healtharea - name: dcp_cscl_nypdprecinct diff --git a/products/cscl/profiles.yml b/products/cscl/profiles.yml index 6712525864..5d076b8a88 100644 --- a/products/cscl/profiles.yml +++ b/products/cscl/profiles.yml @@ -9,3 +9,4 @@ dcp-de-postgres: port: "{{ env_var('BUILD_ENGINE_PORT') | as_number }}" dbname: "{{ env_var('BUILD_ENGINE_DB') }}" schema: "{{ env_var('BUILD_ENGINE_SCHEMA') }}" + threads: 4 diff --git a/products/cscl/recipe.yml b/products/cscl/recipe.yml index a5aa4b5e46..d1480611d7 100644 --- a/products/cscl/recipe.yml +++ b/products/cscl/recipe.yml @@ -110,6 +110,26 @@ inputs: custom: filename: ETL Working GDB.gdb.zip layer_name: CensusTract2020 + - name: dcp_cscl_gdb + import_as: dcp_cscl_cdta2020 + custom: + filename: ETL Working GDB.gdb.zip + layer_name: CDTA2020 + - name: dcp_cscl_gdb + import_as: dcp_cscl_cdtaequiv2020 + custom: + filename: ETL Working GDB.gdb.zip + layer_name: CDTAEquiv2020 + - name: dcp_cscl_gdb + import_as: dcp_cscl_nta2020 + custom: + filename: ETL Working GDB.gdb.zip + layer_name: NTA2020 + - name: dcp_cscl_gdb + import_as: dcp_cscl_ntaequiv2020 + custom: + filename: ETL Working GDB.gdb.zip + layer_name: NTAEquiv2020 - name: dcp_cscl_gdb import_as: dcp_cscl_healtharea custom: @@ -340,3 +360,25 @@ exports: filename: StatenIslandThinFire.txt format: dat custom: { formatting: thinfire_dat } + + # CDTA 2020 + - name: cdta2020_dat + filename: CDTA2020.txt + format: dat + custom: { formatting: cdta2020_dat } + - name: cdta2020_csv + filename: CDTA2020.csv + format: csv + custom: + line_endings: crlf + + # NTA 2020 + - name: nta2020_dat + filename: NTA2020.txt + format: dat + custom: { formatting: nta2020_dat } + - name: nta2020_csv + filename: NTA2020.csv + format: csv + custom: + line_endings: crlf diff --git a/products/cscl/seeds/text_formatting/text_formatting__cdta2020_csv.csv b/products/cscl/seeds/text_formatting/text_formatting__cdta2020_csv.csv new file mode 100644 index 0000000000..2a3f6cb7db --- /dev/null +++ b/products/cscl/seeds/text_formatting/text_formatting__cdta2020_csv.csv @@ -0,0 +1,4 @@ +field_number,field_name,field_label,field_length,start_index,end_index,justify_and_fill,blank_if_none +CDTA1,cdta_code,CDTA Code,4,1,4,LJSF,FALSE +CDTA2,cdta_name,CDTA Name,75,5,79,LJSF,FALSE +CDTA3,cdta_type,CDTA Type,3,80,82,RJSF,FALSE diff --git a/products/cscl/seeds/text_formatting/text_formatting__cdta2020_dat.csv b/products/cscl/seeds/text_formatting/text_formatting__cdta2020_dat.csv new file mode 100644 index 0000000000..438b5f7932 --- /dev/null +++ b/products/cscl/seeds/text_formatting/text_formatting__cdta2020_dat.csv @@ -0,0 +1,4 @@ +field_number,field_name,field_label,field_length,start_index,end_index,justify_and_fill,blank_if_none +CDTA1,cdta_code,CDTA Code,4,1,4,LJSF,FALSE +CDTA2,cdta_name,CDTA Name,77,5,81,LJSF,FALSE +CDTA3,cdta_type,CDTA Type,1,82,82,LJSF,FALSE diff --git a/products/cscl/seeds/text_formatting/text_formatting__nta2020_csv.csv b/products/cscl/seeds/text_formatting/text_formatting__nta2020_csv.csv new file mode 100644 index 0000000000..c983344fcc --- /dev/null +++ b/products/cscl/seeds/text_formatting/text_formatting__nta2020_csv.csv @@ -0,0 +1,5 @@ +field_number,field_name,field_label,field_length,start_index,end_index,justify_and_fill,blank_if_none +NTA1,nta_code,NTA Code,6,1,6,LJSF,FALSE +NTA2,nta_name,NTA Name,75,7,81,RJSF,FALSE +NTA3,nta_abbrev,NTA Abbrev,10,82,91,RJSF,FALSE +NTA4,nta_type,NTA Type,1,92,92,LJSF,FALSE diff --git a/products/cscl/seeds/text_formatting/text_formatting__nta2020_dat.csv b/products/cscl/seeds/text_formatting/text_formatting__nta2020_dat.csv new file mode 100644 index 0000000000..c983344fcc --- /dev/null +++ b/products/cscl/seeds/text_formatting/text_formatting__nta2020_dat.csv @@ -0,0 +1,5 @@ +field_number,field_name,field_label,field_length,start_index,end_index,justify_and_fill,blank_if_none +NTA1,nta_code,NTA Code,6,1,6,LJSF,FALSE +NTA2,nta_name,NTA Name,75,7,81,RJSF,FALSE +NTA3,nta_abbrev,NTA Abbrev,10,82,91,RJSF,FALSE +NTA4,nta_type,NTA Type,1,92,92,LJSF,FALSE diff --git a/products/factfinder/README.md b/products/factfinder/README.md index a2cd29fb3f..aec3a132a0 100644 --- a/products/factfinder/README.md +++ b/products/factfinder/README.md @@ -92,10 +92,6 @@ collection of CBs, ranging from 1.2k to 8k people. When they get too large/small Approximation of a neighborhood (e.g. Park Slope) built out of Census Tracts. [census, ACS] -#### CDTA: -approximation of a CD, composed of NTAs. -[census, ACS] - So All together, the building blocks are: #### CDTA > NTA > CT > CB @@ -106,6 +102,10 @@ So All together, the building blocks are: Redrawn each decade for census. [census, ACS] +#### CDTA: +approximation of a CD, composed of NTAs. +[census, ACS] + #### CD (community district) Similar in size/location to CCD, but are effectively unchanging (at least since 1975) [census (non-detailed, similar to CB)]