Skip to content

Commit

Permalink
Cleaned up a little conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sdl60660 committed Dec 28, 2021
1 parent 09cc2f9 commit 1595586
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/components/utils/geoUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,19 @@ export const assignParentFeatureNames = (flowlines, nameOverrides, inlandFeature
const { nameid, levelpathi } = feature.properties;

if (nameid === "unknown") {
const overrideEntry = nameOverrides[levelpathi];

if (overrideEntry) {
feature.properties.feature_name = overrideEntry.feature_name;
feature.properties.feature_id = overrideEntry.feature_name;
}
else {
feature.properties.feature_name = `Unidentified River ${feature.properties.levelpathi}`;
feature.properties.feature_id = levelpathi;
}
feature.properties.feature_name = `Unidentified River ${feature.properties.levelpathi}`;
feature.properties.feature_id = levelpathi;
}
else {
feature.properties.feature_name = nameid
feature.properties.feature_id = nameid;
}

const overrideEntry = nameOverrides[levelpathi];
if (overrideEntry) {
feature.properties.feature_name = overrideEntry.feature_name;
feature.properties.feature_id = overrideEntry.feature_name;
}
});

const mappedFlowlines = Object.fromEntries(flowlines.map(d => [d.properties.comid, d]));
Expand Down

1 comment on commit 1595586

@vercel
Copy link

@vercel vercel bot commented on 1595586 Dec 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.