transitous icon indicating copy to clipboard operation
transitous copied to clipboard

Address autocompletion

Open vkrause opened this issue 6 months ago • 13 comments

By default this is handled by the address module of MOTIS. That however gets OOM-killed when importing the European OSM dataset.

In particular this happens here: https://github.com/motis-project/address-typeahead/blob/b6b5e60faac2921f1c0b3813da9c11731a3ca31d/src/extractor.cc#L404

NodeLocationsForWays's use of osmium::index::map::FlexMem shows up in Heaptrack as the main cost when testing with the CH subset, however still in "sparse" mode of FlexMem there (due to the dataset being smaller). When explicitly forcing "dense" mode (which is expected to be used for the EU dataset) even the CH subset runs out of memory (assuming I did that correctly).

Possible scenarios/approaches:

(1) Disable address autocompletion.

Limited loss of features in the web ui, but not ideal.

(2) Bug in FlexMem use of https://github.com/motis-project/address-typeahead

It's quite possible nobody has tried to load such a large OSM subset into this, and thus even realistic to fix/optimize issues have remained in that code path. Needs further investigation, but if that's the case would allow to enable this feature without requiring extra work or setup.

(3) External address autocompleter

Possible alternatives exist, such as Nominatim (OSM's default, supports incremental updates and proven to scale to the full planet dataset), or Photon (used by some Digitransit/OTP installations AFAIK). Integration into MOTIS would need work but doesn't appear too difficult.

vkrause avatar Feb 15 '24 17:02 vkrause