-
Notifications
You must be signed in to change notification settings - Fork 118
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
Make NSI country filter uniform #2386
Conversation
- Let all plugins use `nsi_rule_applies` to evaluate the locationSet - Allow country codes with subcodes (like NL-GE)
In case the geojson file of NSI is named like an Osmose extract (e.g. like US Iowa, or Quebec (CA), it'll support include/exclude statements for those subregions.
Sub country code was not done before because of not matching Osmose definition and could raise bad Osmose issues. |
You mean that the same country code (like Currently, by not supporting it we also have false positives, e.g. this detection shouldn't exist because it's rule is excluding CA-QC. However, since we (without this patch) don't check for the Of course this would only affect cases where our division is the same (US-IA) or smaller (CA-QC-*) than theirs, and the naming scheme is similar. For France for instance we use FR-[number] rather than FR-[letters]-[number], so that would really require a map and/or third party library. On the other hand, if they use a smaller subdivision than Osmose, it's unfixable at the moment (unless we start comparing node coordinates rather than extracts). However, those cases wouldn't be affected by this patch, would they? |
Not the boundaries, but the code itself. The issue is about making the map of the codes. Maybe we can change some code on Osmose side, to match national or supra national code (if it can help to match NSI code). |
I don't understand. Making a map for the remaining cases (e.g. FR-ABC = [FR-1, FR-2, FR-3]) could be in a future PR. (I first want to explore if it's possible to use that library before making a hardcoded map). |
I reread the code. Today the country is always the 2 chars country code, even for sub country area. If I'm not wrong, when a rule exclude a subpart, the 2-chars only country code make the rule excluded, doesn't ? Concerning France sub areas, It looks like to me subarea codes are not used, but always geojson. |
I'm not sure if I understand what you mean.
Without this PR, it would only check for This PR doesn't do anything if the geojson isn't named the same as the Osmose subdivisions, e.g. France is unaffected, Denmark is unaffected, ... (see issue for full list) |
I was thinking the code was doing a smart thing with exclusion... but it does not. Sorry, yes this PR will improve the results without introduce more false positive. |
nsi_rule_applies
, to evaluate the locationSet of NSIThis doesn't fix 2358 completely yet, but makes a fix easier.
Also, for cases where the geojson file has the same code as the Osmose extract (such as Iowa, Quebec, ...) this makes it work again.
For canada it also fixes some cases that never worked, e.g. this entry previously wasn't parsed well due to including
ca
but excludingca-qc
. We previously didn't support such "subregion-exclusions".