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
1 change: 0 additions & 1 deletion products/knownprojects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ For detailed information on the tables created throughout the build process, see
- [ ] `Future Neighborhood Rezonings` - `dcp_n_study_future`
- [ ] `Past Neighborhood Rezonings` - `dcp_n_study_projected`
- [ ] `HPD Requests for Proposals (RFPs)` - `hpd_rfp`
- [ ] `HPD Projected Closing` - `hpd_pc`
- [ ] `DCP Planner Added Projects` - `dcp_planneradded`

**Make sure the following are up-to-date in edm-recipes:**
Expand Down
1 change: 0 additions & 1 deletion products/knownprojects/bash/01_dataloading.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ python3 -m python.extractors dcp_n_study
python3 -m python.extractors dcp_n_study_future
python3 -m python.extractors dcp_n_study_projected
python3 -m python.extractors hpd_rfp
python3 -m python.extractors hpd_pc
python3 -m python.extractors dcp_planneradded
python3 -m python.extractors dcp_knownprojects

Expand Down
1 change: 0 additions & 1 deletion products/knownprojects/python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"dcp_n_study_future": "future_neighborhoodstudies_20250304.zip",
"dcp_n_study_projected": "past_neighborhoodstudies_20250304.zip",
"hpd_rfp": "HPD_RFPs_20250110.xlsx",
"hpd_pc": "HPD_Pipeline_20250225.xlsx",
"dcp_planneradded": "dcp_planneradded_2025_04_30.csv",
}
DCP_HOUSING_CORRECTIONS_FILENAMES = {
Expand Down
15 changes: 7 additions & 8 deletions products/knownprojects/python/dedup_units.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,13 @@ def resolve_all_projects(df):
# Hierarchy for unit subtraction
hierarchy = {
"DOB": 1,
"HPD Projected Closings": 2,
"HPD RFPs": 3,
"EDC Projected Projects": 4,
"DCP Application": 5,
"Empire State Development Projected Projects": 6,
"Neighborhood Study Rezoning Commitments": 7,
"Neighborhood Study Projected Development Sites": 8,
"DCP Planner-Added Projects": 9,
"HPD RFPs": 2,
"EDC Projected Projects": 3,
"DCP Application": 4,
"Empire State Development Projected Projects": 5,
"Neighborhood Study Rezoning Commitments": 6,
"Neighborhood Study Projected Development Sites": 7,
"DCP Planner-Added Projects": 8,
}

df["source_id"] = df["source"].map(hierarchy)
Expand Down
6 changes: 0 additions & 6 deletions products/knownprojects/python/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ def hpd_rfp(filename: str) -> pd.DataFrame:
return df


@ETL
def hpd_pc(filename: str) -> pd.DataFrame:
df = pd.read_excel(f"{RAW_DATA_PATH}/{filename}", dtype=str)
return df


@ETL
def dcp_planneradded(filename: str) -> pd.DataFrame:
df = pd.read_csv(f"{RAW_DATA_PATH}/{filename}", dtype=str)
Expand Down
98 changes: 0 additions & 98 deletions products/knownprojects/sql/combine.sql
Original file line number Diff line number Diff line change
Expand Up @@ -260,84 +260,6 @@ _esd_projects AS (
GROUP BY project_name, total_units
),

_hpd_pc AS (
SELECT
'HPD Projected Closings' AS source,
a.uid AS record_id,
'HPD 3: Projected Closing' AS status,
NULL AS type,
((
min_of_projected_units::integer
+ max_of_projected_units::integer
) / 2
)::integer AS units_gross,
projected_fiscal_year_range AS date,
'Projected Fiscal Year Range' AS date_type,

-- dates
(CASE
WHEN
date_part(
'year',
age(
to_date((concat(right(projected_fiscal_year_range, 4)::numeric + 3, '-06-30')), 'YYYY-MM-DD'),
current_date
)
)
<= 5
THEN 1
ELSE 0
END)::numeric AS prop_within_5_years,
(CASE
WHEN
date_part(
'year',
age(
to_date((concat(right(projected_fiscal_year_range, 4)::numeric + 3, '-06-30')), 'YYYY-MM-DD'),
current_date
)
)
> 5
AND date_part(
'year',
age(
to_date((concat(right(projected_fiscal_year_range, 4)::numeric + 3, '-06-30')), 'YYYY-MM-DD'),
current_date
)
)
<= 10
THEN 1
ELSE 0
END)::numeric AS prop_5_to_10_years,

-- phasing
(CASE
WHEN
date_part(
'year',
age(
to_date((concat(right(projected_fiscal_year_range, 4)::numeric + 3, '-06-30')), 'YYYY-MM-DD'),
current_date
)
)
> 10
THEN 1
ELSE 0
END)::numeric AS prop_after_10_years,

1 AS phasing_known,

b.wkb_geometry AS geom,
array_append(ARRAY[]::text [], a.uid) AS record_id_input,
house_number || ' ' || street_name AS record_name,
flag_nycha(a::text) AS nycha,
flag_classb(a::text) AS classb,
flag_senior_housing(a::text) AS senior_housing
FROM hpd_pc AS a
LEFT JOIN dcp_mappluto_wi AS b
ON a.bbl::numeric = b.bbl::numeric
),

_hpd_rfp AS (
SELECT
'HPD RFPs' AS source,
Expand Down Expand Up @@ -554,26 +476,6 @@ FROM (
st_makevalid(geom) AS geom
FROM _esd_projects
UNION
SELECT
source,
record_id,
record_name,
status,
type,
units_gross,
date,
date_type,
prop_within_5_years,
prop_5_to_10_years,
prop_after_10_years,
phasing_known,
nycha,
classb,
senior_housing,
record_id_input,
st_makevalid(geom) AS geom
FROM _hpd_pc
UNION
SELECT
source,
record_id,
Expand Down
Loading