Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Performace of osml10n_get_name_without_brackets_from_tags #54

Closed
frodrigo opened this issue Jul 16, 2020 · 5 comments
Closed

Performace of osml10n_get_name_without_brackets_from_tags #54

frodrigo opened this issue Jul 16, 2020 · 5 comments

Comments

@frodrigo
Copy link
Contributor

The current implementation of osml10n_get_name_without_brackets_from_tags is very slow.

Running it on all transport ways of Europe is too long, I did not let it finish, I took more than one day.

When disabling call to osml10n_geo_translit from osml10n_get_name_without_brackets_from_tags it took only around 90s.
https://github.com/giggls/mapnik-german-l10n/blob/master/plpgsql/get_localized_name_from_tags.sql#L361

osml10n_geo_translit itself call to the slow osml10n_get_country (making a spatial query)
https://github.com/giggls/mapnik-german-l10n/blob/master/plpgsql/geo_transliterate.sql#L63
https://github.com/giggls/mapnik-german-l10n/blob/master/plpgsql/get_country.sql

The country is used only when it is 'jp' or 'th'
https://github.com/giggls/mapnik-german-l10n/blob/master/plpgsql/geo_transliterate.sql#L25-L34

I think 'th' would be better detected from Thai alphabet rather than geometry location.

About 'jp' why required to be in Japan to detect if CJK are in name ?

My point of view is that the country detection can be removed.

@giggls
Copy link
Owner

giggls commented Jul 16, 2020

Country detection can not be removed because of the simple reason, that Chinese characters must be transcripted in a different way in China, Japan and HongKong/Makau.

Checking for Thai characters instead of checking for Thailand would be possible, but this is not the reason transcription is slow.

See issue #53 which discusses details about these issues.

@frodrigo
Copy link
Contributor Author

I already read #53, I'm on OpenMapTiles and Imposm, not interested in lua implementation.

I ask about the use of country detection for this particular function, not removing it globally.

frodrigo added a commit to frodrigo/openmaptiles that referenced this issue Jul 16, 2020
@giggls
Copy link
Owner

giggls commented Jul 16, 2020

Well maybe it would be a little bit faster to check for CJK and Thai characters avoiding calling get-country function in some cases. But as I already said I do not really consider this place the main speed problem of this whole approach.

BTW, it would be very easy to add this because contains_cjk function is already there and contains_Thai would be easy to implement.

Maybe you should give my external daemon approach a try using https://github.com/giggls/osml10n/blob/master/cc_transcript_via_daemon.sql

BTW With the advent of the new osm2pgsql flex backend osm2pgsql is now even more flexible than imposm.

@giggls
Copy link
Owner

giggls commented Jul 16, 2020

I just added a check for CJK and Thai before calling osml10n_get_country.
This might speed up the code a little bit in countries like Russia, Greece, Israel and the Arab world.

@frodrigo
Copy link
Contributor Author

Thank you.

frodrigo added a commit to frodrigo/openmaptiles that referenced this issue Jul 20, 2020
frodrigo added a commit to frodrigo/openmaptiles that referenced this issue Jul 22, 2020
frodrigo added a commit to frodrigo/openmaptiles that referenced this issue Jul 23, 2020
frodrigo added a commit to frodrigo/openmaptiles that referenced this issue Jul 23, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Jul 27, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Jul 31, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Jul 31, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 3, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 4, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 5, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 5, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 6, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 10, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 11, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Aug 28, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Sep 22, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Sep 25, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Sep 28, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Sep 29, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Oct 8, 2020
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Feb 23, 2021
frodrigo added a commit to makina-maps/openmaptiles that referenced this issue Mar 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants