Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WMEPH complains sea/lake/ponds without names should be points, not areas #430

Open
mapomatic opened this issue Jun 30, 2023 · 2 comments
Open

Comments

@mapomatic
Copy link
Member

No description provided.

@jangliss
Copy link
Member

jangliss commented Aug 27, 2023

I think I've figured out what's going on here, and it'll impact other such checks, like the "area should be a point" or "point should be an area" checks (amongst others I'm sure). There's no code to actually check the spreadsheet data. The only conditions are fixed values.

The current code looks like this:

static venueIsFlaggable(args) {
    return !args.venue.isPoint()
        && (args.categories.includes(CAT.RESIDENCE_HOME) || (args.maxAreaSeverity > SEVERITY.BLUE && !args.categories.includes(CAT.REST_AREAS)));
}

Note it only looks at the severity, and if the category is a resident or rest area. There's nothing actually looking at the sheet. To fix, or at least cobbled together a a PoC for the fix, I did this:

static venueIsFlaggable(args) {
    let areaFlag = false
    if (args.categories.length > 0) {
        args.categories.forEach( elem => { areaFlag = (args.pnhCategoryInfos.getById(elem).area) ? true : areaFlag } )
    }
    return !args.venue.isPoint() && !areaFlag
        && (args.categories.includes(CAT.RESIDENCE_HOME) || (args.maxAreaSeverity > SEVERITY.BLUE && !args.categories.includes(CAT.REST_AREAS)));
}

There's probably a prettier way to do it that lines up with the rest of the code.

@jangliss
Copy link
Member

Hmmm, think I misunderstood how this is doing the lookups, and the pc_point and pc_area on the sheet are scores, not flags to show they are supposed to be one or the other? Question then becomes, why is the score not being set or used properly. More digging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants