irceline / aq-mobile-be

App for consulting air quality data in Belgium using the ionic framework for Android and iOS
Apache License 2.0
7 stars 8 forks source link

Let auto-complete give a customisable selection of locations #247

Closed opeeters closed 3 years ago

opeeters commented 3 years ago

Currently the auto-complete when entering locations by hand gives by default the 5 first lines from locations.json. It would be better to give a list of the biggest cities/agglomerations, e.g.: Brussels, Antwerp, Liége, Ghent, Charlerio

janschulte commented 3 years ago

You can configure the wished locations now in the settings.json with the parameter defaultSelectableLocations

opeeters commented 3 years ago

Super! Thanks!

opeeters commented 3 years ago

One more thing, what would be the best way to make this language aware?

janschulte commented 3 years ago

Not that trivial. As I understand this right, you want different denotation for cities regarding the selected language?

Currently there are checks between the labeling of locations, when there is added a new location. Maybe we switch here to a location based check. Because otherwise a user is able to add the same city in different languages.

For the city name translation the best place should be the locations.json, I would say.

opeeters commented 3 years ago

We still need to refine locations.json. The most notable mistakes have been fixed manually, but it should be possible to create a better reproducible compilation base extraction from OSM by refining zipcodeParser.js. Let's discuss this after the break.

janschulte commented 3 years ago

TODO: Add postalcodes to labels

opeeters commented 3 years ago

Potentially limiting name matches to the OSM Admin Level = 8 would improve the mapping between name and location and the translation as a consequence.

Take Hasselt as an example. The location of the initial match was the centroid of the OSM feature Hasselt of Admin Level 7: https://nominatim.openstreetmap.org/ui/details.html?osmtype=R&osmid=2412218&class=boundary

placing the location lat/long outside the city ring.

The correct feature to match would have been the feature of Admin Level 8: https://nominatim.openstreetmap.org/ui/details.html?osmtype=R&osmid=1230716&class=boundary

janschulte commented 3 years ago

I restructured the location list creation with a search based on city name AND postalcode now, seems to work much more better. Besides that, I also add the postalcode to the UI selection.

opeeters commented 3 years ago

Excellent ;-)