osm-fr / osmose-backend

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

NSI-utilizing plugins break due to NSI `locationSet` conversion from country code to geojson file #2385

Open Famlam opened 2 weeks ago

Famlam commented 2 weeks ago

This commit of the name-suggestion-index causes the tests of TagFix_Brand to fail. (Note there were more commits of a similar type)

Reason: in this plugin (and 2 others) we check the country versus the country code, e.g. FR. However, it's now changed to fr-pac.geojson (and several others, like fr-20r.geojson)

Affected plugins:

Proposed fix:

  1. make all locationSet-parsing-code uniform and support subdivided countries -> #2386
  2. where possible, convert the geojson file names to country codes (e.g. BR-AC.geojson can be converted by just dropping .geojson from the file name (and homogenize case for some countries)) Countries where this will work: AT, AU, BR, CA, CH, (part of) DE, ES, IT, MX, (part of) PH, (part of) US -> also #2386
  3. where not possible (e.g. France, which Osmose divides into departments, but NSI into arrondissements) use a map. Unless there's a very efficient way to check if an Osmose-division is fully within an NSI-division (while considering tiny border differences). (Or maybe make modifications to osmose_config in case it's divided in smaller divisions in NSI). Or maybe use the library they use with the isIn function (but then we should also fetch the geojson files) Countries/regions: (part of) DE, DK, FR, GB, IE, JP, NZ, (part of) PH, ru-spe, (part of) US, some special cases (e.g. crimea)