WMEValidator / validator

WME Validator Source Files
GNU General Public License v3.0
11 stars 10 forks source link

Fixes getting MPH vs KPH based on segment #83

Closed davidakachaos closed 5 years ago

davidakachaos commented 5 years ago

Example PL: https://www.waze.com/nl/editor?env=usa&lon=-99.50151&lat=27.49976&zoom=5

This situation has the issue that a editor can edit in a country which is imperial (the US) and metrical (Mexico) what causes Validator to flag segments as having the wrong speed. This fixes that by looking at the country of a segment and converting the speed to mph or not according to a exception list.

The list of countries using MPH is a given and can be hardcoded imo.

This change was discused in #79

berestovskyy commented 5 years ago

I thought we could avoid kmh->mph conversion at all. Just customize the checks for the imperial countries with the corresponding regexps. But it's ok, let's merge it for now.