pelias / labels

Pelias Label generation
https://pelias.io
MIT License
4 stars 9 forks source link

Add Singapore schema without region or country #45

Closed orangejulius closed 3 years ago

orangejulius commented 3 years ago

This is a PR that should be merged after #43, where we add the region to most labels by default.

After looking at the changes from #43, it seems like Singapore is a case where the labels are significantly worse. While Singapore does have regions, I could not find any references to them being included in most addresses under normal use.

Libpostal does not have any address format data, nor does Nominatim as far as I can tell.

Overall, since Singapore is both a city, and a country, I think the right thing to do is to only display Singapore once, without any region. That means the label code actually only looks at the locality value, not the region or even country. I suppose it could look at country but not locality, but I assume that will generally be equivalent.

missinglink commented 3 years ago

:+1: I've been to Singapore a few times and noone uses the districts such as 'South' or 'West' but the neighborhood name such as 'Sentosa' is important for navigation.

We should include the neighborhood/suburb/locality whatever it's called where available.

https://www.singaporeexpats.com/housing-in-singapore/singapore-district-guide.htm

orangejulius commented 3 years ago

Ah, bummer, looks like we really don't have good data in WOF for the districts.

There are no neighbourhods. There are quite a few localities but they are mostly point geometries, and don't seem to match up with those districts.

Looks like https://github.com/whosonfirst-data/whosonfirst-data/issues/1109 and/or https://github.com/whosonfirst-data/whosonfirst-data/issues/1092 track improvements there.

missinglink commented 3 years ago

I've added a comment on https://github.com/whosonfirst-data/whosonfirst-data/issues/1092, if we get a decision from the WOF team about which placetype will contain the term (options would be either neighbourhood or microhood) then we can add it to the schema and merge, once the data is updated it'll fix itself naturally.

Otherwise I'm happy to merge this as-is since it represents our best effort at this time.

orangejulius commented 3 years ago

Yeah, I think I've figured out a way to support the current format for now, and naturally adopt to the future format:

The local value (normally city, but clearly in Singapore this is a district) comes from the first of macrohood and neighbourhood.

The country value comes from country, as normal. This is also nice since it's a lot more like most of the other label schemas.

Tests included and they all pass, so I think this is still good to go and should be reasonably future proof. I'm sure we'll have to update something, but maybe we're a bit closer.

missinglink commented 3 years ago
FWIW if we wanted to generalize it to just 5 levels which were generic enough to use globally, we could probably get away with: level place types
Country admin1 [country, dependency]
Region admin2 [state (US), province (CA), canton (CH), länder(DE)]
District admin3 micro-region [county, territory] OR macro-locality [metro area, city]
Locality admin4 [town, village, suburb, borough, bezirk, hamlet, township, etc.]
Quarter admin5 micro-locality [neighbourhood, kiez, quarter, barrio, square, park etc.]