NYCPlanning / db-developments

šŸ  šŸ˜ļø šŸ—ļø Developments Database
https://nycplanning.github.io/db-developments
8 stars 2 forks source link

20Q2 - Occupancy Code Master Issue #27

Closed AmandaDoyle closed 4 years ago

AmandaDoyle commented 4 years ago

Goal

New Occupancy Code Lookup DOB Occupancy Code | 20Q2 Value -- | -- .RES | Residential: Not Specified (.RES) A | Industrial: High Hazard (A) A-1 | Assembly: Theaters, Churches (A-1) A-2 | Assembly: Eating & Drinking (A-2) A-3 | Assembly: Other (A-3) A-4 | Assembly: Indoor Sports (A-4) A-5 | Assembly: Outdoors (A-5) B | Commercial: Offices (B) B-1 | Storage: Moderate Hazard (B-1) B-2 | Storage: Low Hazard (B-2) C | Commercial: Retail (C) COM | Commercial: Not Specified (COM) D-1 | Industrial: Moderate Hazard (D-1) D-2 | Industrial: Low Hazard (D-2) E | Unknown (E) F-1 | Industrial: Moderate Hazard (F-1) F-1A | Assembly: Theaters, Churches (F-1A) F-1B | Assembly: Theaters, Churches (F-1B) F-2 | Unknown (F-2) F-3 | Assembly: Museums (F-3) F-4 | Assembly: Eating & Drinking (F-4) G | Educational (G) H-1 | Unknown (H-1) H-2 | Unknown (H-2) H-3 | Industrial: High Hazard (H-3) H-4 | Industrial: High Hazard (H-4) H-5 | Industrial: High Hazard (H-5) I-1 | Institutional: Assisted Living (I-1) I-2 | Institutional: Incapacitated (I-2) I-3 | Institutional: Restrained (I-3) I-4 | Institutional: Day Care (I-4) J-0 | Residential: 3 or More Units (J-0) J-1 | Residential: Hotels, Dormitories (J-1) J-2 | Residential: 3 or More Units (J-2) J-3 | Residential: 1-2 Family Houses (J-3) K | Miscellaneous (K) M | Commercial: Retail (M) NC | Residential: 3 or More Units (NC) PUB | Assembly: Other (PUB) R-1 | Residential: Hotels, Dormitories (R-1) R-2 | Residential: 3 or More Units (R-2) R-3 | Residential: 1-2 Family Houses (R-3) RES | Residential: Not Specified (RES) S-1 | Storage: Moderate Hazard (S-1) S-2 | Storage: Low Hazard (S-2) U | Miscellaneous (U)

Relevant Issues:

71 OCC 1968 Occupancy code look up not unique

45 Clean up address_number values

6 Logic to recode occ_category from Other to Residential

26 QAQC - output jobs where occ_category = Other and units_init/prop <> 0 for research

mgraber commented 4 years ago

@SPTKL Finding new building addresses that have both a garage and non-garage job use address||'-'||_units_prop::text as the unique ID in _occ.sql. Are units_prop reliably the same between the garage and non-garage record in cases where both exist? Does this constraint miss cases?

SPTKL commented 4 years ago

I guess using address||'-'||_units_prop::text is a more conservative unique key? we assume that jobs with the same address and units_prop are the same project.

kschmidtDCP commented 4 years ago

Use this table to recode occ_init and occ_prop. It fixes the duplicate issue and addresses our desire for better categories. https://nyco365.sharepoint.com/:x:/r/sites/NYCPLANNING/hed/Shared%20Documents/01%20Projects_active/Housing%20(only%20current%20items)/20Q2/Occupancy%20Recode%2020Q2.xlsx?d=w60d8c706cb72475a94b11d6274e26f02&csf=1&web=1&e=w16ub2

HED has many comments on the utility of the old occupancy code: https://github.com/NYCPlanning/db-developments/blob/master/developments_build/sql/occ_.sql We should discuss in a call.

kschmidtDCP commented 4 years ago

@AmandaDoyle @SPTKL @mgraber I just want to confirm that the 19Q4 field occ_category will be renamed resid_flag as noted in the schema. occ_category values previously listed as "Other" will be replaced will nulls and moved to the new nonres_flag.

mgraber commented 4 years ago

@kschmidtDCP @levysamu The nonres_flag will simply be the opposite of resid_flag, correct? Are there any cases where either both would be 'Y' or both would be NULL? What is the value of including both?

mgraber commented 4 years ago

Is the new field nonres_flag simply the opposite of resid_flag? If so, what is the value of including both? Related to #27

These are not mutually exclusive, so if a building contains both residential and nonresidential uses (like retail) both flags would be applied.

@kschmidtDCP What is the logic for setting the nonres_flag, if it is independent from the logic for setting resid_flag?

kschmidtDCP commented 4 years ago

Is the new field nonres_flag simply the opposite of resid_flag? If so, what is the value of including both? Related to #27

These are not mutually exclusive, so if a building contains both residential and nonresidential uses (like retail) both flags would be applied.

@kschmidtDCP What is the logic for setting the nonres_flag, if it is independent from the logic for setting resid_flag?

@kschmidtDCP @levysamu The nonres_flag will simply be the opposite of resid_flag, correct? Are there any cases where either both would be 'Y' or both would be NULL? What is the value of including both?

In the case of these flags, the resid_flag should be populated with "Residential" if true, and null if false. nonres_flag should be populated with "Non-Residential" if true, and null if false.

kschmidtDCP commented 4 years ago

Is the new field nonres_flag simply the opposite of resid_flag? If so, what is the value of including both? Related to #27

These are not mutually exclusive, so if a building contains both residential and nonresidential uses (like retail) both flags would be applied.

@kschmidtDCP What is the logic for setting the nonres_flag, if it is independent from the logic for setting resid_flag?

@mgraber The logic is in issue #49.

SPTKL commented 4 years ago

the qaqc portion of this issue will be addressed in #106

AmandaDoyle commented 4 years ago

@SPTKL I'm reviewing the code in the dev branch and 'occ_category' is still dependent on 'occ_initial' and 'occ_proposed', but I thought that occ_category (now resid_flag) was set to residential if any of the 6 unit fields had a value. Question I have is non-residential units are captured in DOB unit counts, and how does HED plan to capture non-residential units?

levysamu commented 4 years ago

@AmandaDoyle, not sure I understand your question. Are you asking whether DoB counts class b units in their unit counts? If that is your question, then yes they do. Sometimes. They are inconsistent, but I think generally speaking they do count them as units. We have a bunch of QAQC checks to determine whether something has class b units, and we expect to find most, if not all of, them that way.

kschmidtDCP commented 4 years ago

@AmandaDoyle @mgraber @SPTKL From issue #100

Previously we used occupancy initial and proposed fields to assign the resid_flag value; however, based on new logic you only want to assign something as residential if the record has a value in one of the 6 unit fields. Does this make sense?

Yes, that is correct. The occupancy codes are an unreliable way of identifying residential units, and so we're switching to basing resid_flag solely on the presence of residential units.

How will non residential units be captured or removed?

The b_nonres_with_units QC check for jobs where the occ_init and oc_prop are not residential, but there is a value in units_init or occ_prop. This check will make sure that suspected non-residential units are removed from units_init and units_prop. #106

AmandaDoyle commented 4 years ago

@levysamu @kschmidtDCP I understand what Class A units are (permanent residences) and hotel units, but what are Class B units? I understood class B units to be things like SROs.

1) I'm wondering where non residential units(i.e. offices) are being captured in the developments database.

2) My concern is that is we're mapping units from the DOB application, which captures all unit types, to class A fields, AND using the 6 unit fields to assign something as being residential or not. Therefore, it's HED's responsibility to thoroughly go through and correctly break out the units for each record, and if HED misses some details then a record can be misclassified as as residential. I'm wondering what the benefit is to divorce the residential flag, from the initial and proposed occupancy codes. Maybe we can talk this through tomorrow.

AmandaDoyle commented 4 years ago

@kschmidtDCP for whatever reason I'm just seeing your response. Okay, as long as it's documented that it's vital for HED to do this research I think I'm okay with the new logic. Are non-residential units captured anywhere in the database? Should they be?

levysamu commented 4 years ago

@AmandaDoyle, as far as I can tell DoB does not report non-residential units like office or retail space. They report non-residential units in PLUTO, but not as part of the DoB permitting process.

And yes, Other B is referring to things like SROs or dormitories.

AmandaDoyle commented 4 years ago

@levysamu I'm concerned because I'm looking at the raw data and jobs with non residential initial and proposed occupancy codes and assigned an occupancy code as Other have values in the units initial and proposed columns, and I'm unclear on what DOB defines as a dwelling unit. https://data.cityofnewyork.us/Housing-Development/DOB-Job-Application-Filings/ic3t-wcy2

AmandaDoyle commented 4 years ago

Reclosing issues because we confirmed that the logic should be If there is a value in the classA, classB, and hotel units field make residential flag TRUE This logic is already implemented