PNHP / COA

Pennnsylvania Conservation Opportunity Area Tool development scripts
GNU General Public License v3.0
2 stars 1 forks source link

aggregation of habitat area by planning unit fails if only one habitat type is present. #51

Closed ChristopherTracey closed 7 years ago

ChristopherTracey commented 7 years ago

possible fix to bypass aggregation step if only one type is present.

ChristopherTracey commented 7 years ago

Actually, this bug wasn't related to the terrestrial habitats, but rather the lotic habitats. If the selected planning units, do not intersect an NHD flowline, then the tool reports back with an error. I think I was confused about the initial bug as it was showing up in a test case where there was only one habitat.

Fixed by putting the lotic table aggregation within a 'if' statement to check if the dataframe is empty.

I don't think we need to do anything similar for the terrestrial habitats, as they have wall to wall coverage across the state. May want to consider for SGCN though.