File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed
Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ python3 -m python.extractors dcp_n_study_projected
2121python3 -m python.extractors hpd_rfp
2222python3 -m python.extractors dcp_planneradded
2323python3 -m python.extractors dcp_knownprojects
24+ python3 -m python.extractors dcp_hudsonsquare
2425
2526# Load corrections tables
2627run_sql_file sql/create_corrections.sql
Original file line number Diff line number Diff line change 3333 "dcp_n_study_projected" : "past_neighborhoodstudies_20260305.zip" ,
3434 "hpd_rfp" : "HPD_RFPs_20250110.xlsx" ,
3535 "dcp_planneradded" : "dcp_planneradded_2025_04_30.csv" ,
36+ "dcp_hudsonsquare" : "HudsonSquare_P2012M0255_4326.zip" ,
3637}
3738DCP_HOUSING_CORRECTIONS_FILENAMES = {
3839 "corrections_dob" : "corrections_dob.csv" ,
Original file line number Diff line number Diff line change @@ -72,6 +72,17 @@ def dcp_n_study_projected(filename: str) -> gpd.GeoDataFrame:
7272 return df
7373
7474
75+ @ETL
76+ def dcp_hudsonsquare (filename : str ) -> gpd .GeoDataFrame :
77+ # df = gpd.read_file(f"zip://{RAW_DATA_PATH}/{filename}")
78+
79+ filename_prefix = f"{ filename } " .split ("." )[0 ]
80+ with zipfile .ZipFile (f"{ RAW_DATA_PATH } /{ filename } " , "r" ) as zip_ref :
81+ zip_ref .extractall (f"{ RAW_DATA_PATH } " )
82+ df = gpd .read_file (f"{ RAW_DATA_PATH } /{ filename_prefix } /{ filename_prefix } .shp" )
83+ return df
84+
85+
7586@ETL
7687def hpd_rfp (filename : str ) -> pd .DataFrame :
7788 df = pd .read_excel (f"{ RAW_DATA_PATH } /{ filename } " , dtype = str )
Original file line number Diff line number Diff line change @@ -347,6 +347,20 @@ geom_ulurp AS (
347347 ) AS a LEFT JOIN dcp_zoningmapamendments AS zma
348348 ON a .dcp_ulurpnumber = zma .ulurpno
349349 GROUP BY a .record_id , a .geom
350+ ),
351+
352+ -- Correcting geometry for Hudson Square project (P2012M0255) while using old ZAP data
353+ geom_corrections AS (
354+ SELECT
355+ a .record_id ,
356+ CASE
357+ WHEN a .record_id = ' P2012M0255'
358+ THEN b .geometry
359+ ELSE a .geom
360+ END AS geom
361+ FROM geom_ulurp AS a
362+ LEFT JOIN dcp_hudsonsquare AS b
363+ ON a .record_id = b .projectid
350364)
351365
352366-- Main table with the geometry lookup
@@ -355,5 +369,5 @@ SELECT
355369 b .geom
356370INTO dcp_application
357371FROM _dcp_application AS a
358- LEFT JOIN geom_ulurp AS b
372+ LEFT JOIN geom_corrections AS b
359373 ON a .record_id = b .record_id ;
You can’t perform that action at this time.
0 commit comments