kcigeospatial / balt_co_ETL

This will provide a place to track internal issues around the Baltimore County NPDES NCT application ETL.
0 stars 0 forks source link

Stormwater selection set 1D - MDE.BMP.BMP_DRAIN_ID is orphan, but should be valid MDE DA ID #93

Open leeensminger opened 6 years ago

leeensminger commented 6 years ago

@gerrykelly Issue 414 appears to be a valid issue. I edited source records so that only POI000002 (RY = 2001) matches the scenario – in which the source POI has a DA, but the source SW Tracking does not have associated DAs. In this scenario, MDE.BMPDrainageArea.BMPPOI_ID is correctly populated, but MDE.BMP.BMP_DRAIN_ID is “orphan”, but should be BA01BDA003734 (the BMP Drain ID for the DA associated to the POI).

image

gerrykelly commented 6 years ago

@dhenry-KCI This fixed at KCI and code committed to GH ("Update for BMP drain ID when DA has no sw tracking ID " comment on https://github.com/kcigeospatial/balt_co_npdes/blob/master/GP_services/ETL/ETL_GP/tableMaker.py

@leeensminger Thanks for making this a simple test case. Since the info to fix this was already in the output I was able to just add a little followup routine to cover this scenario.

Basic logic was: • Select BMPPOI_ID, BMP_DRAIN_ID from BMP where BMP_DRAIN_ID = ‘orphan’ • For each selected o Select BMP_DRAIN_ID, from BMP Drainage Area where BMPPOI_ID = BMP. BMPPOI_ID o Update the BMP. BMP_DRAIN_ID if a record is found