osm-fr / osmose-backend

Part of osmose that runs the analysis, and send the results to the frontend.
GNU General Public License v3.0
90 stars 114 forks source link

Housenumber rule to restrictive for CW / Curacao #2096

Closed osm-roelant closed 9 months ago

osm-roelant commented 9 months ago

source 9640 item 2060 class 10

After touching a couple of houses in Curaçao which have a house number starting with a letter (verified locally), osmose marks the edit with [2060 street numbers ] [Invalid addr:housenumber value].

I've marked most as invalid, but left one open as an example: https://osmose.openstreetmap.fr/en/issue/2137130a-e344-63a8-5afe-302c2bd7ef4e

This refers to: https://github.com/osm-fr/osmose-backend/blob/master/plugins/TagFix_Housenumber.py#L33

Possible solutions

Implement similar rule as for NL for CW, or just add CW to the same set of rules for NL, as these already provide for this scenario and Curaçao actually is part of the Kingdom of the Netherlands so it kinda makes sense that the same applies.

elif country == 'NL':
            # Baseline:
            #   https://imbag.github.io/catalogus/hoofdstukken/attributen--relaties#734-huisnummertoevoeging
            #   (7.3.2 huisnummer, 7.3.3 huisletter and 7.3.4 huisnummertoevoeging)
            # Exceptions to the rule:
            #   https://nl.wikipedia.org/wiki/Huisnummer
            # This pattern isn't exhaustive, but it should catch most weirdness.
            self.housenumber = re.compile(
                # Houseboats, 't/o X' stands for 'opposite X', where 'X' is an address on shore
                r"^(t/o )?"
                # 'Pekela'-style exception, leading letter (e.g., 'C54')
                "(([A-Z][1-9][0-9]{0,3})|"
                # Normal base numbers, no leading zero, not exceeding 5 digits.
                "([1-9][0-9]{0,4}))"
                # Up to four optional extensions (can have leading zeroes in the extension part, e.g., '2K-008')
                "([ -/]?(([0-9]{1,4})|([A-Za-z]{1,5}))){0,4}$")

I'm unsure whether this also applies to other islands similarly related to the Kingdom of the Netherlands.

Famlam commented 9 months ago

I can't find anything about the rules for house numbers in Curacao. Applying the "NL"-rules would fix most, and it could make sense due to the historical connection, but e.g. the cases near Blue Bay wouldn't be fixed by that. (However, as those streets are called "Section T" etc, this may also be that people just tried to combine the full address in their house number plates, e.g. Blue Bay section D number 123 -> BD123, in which case Osmose is probably still right)

I'm unsure whether this also applies to other islands similarly related to the Kingdom of the Netherlands.

The other islands don't seem to be affected, given the very low number of warnings on those islands.