Nominatim icon indicating copy to clipboard operation
Nominatim copied to clipboard

Use search_name table for TIGER data imports on 'dropped' databases

Open lonvia opened this issue 3 years ago • 3 comments

When somebody has run the import with --drop or dropped the update information at a later point, it is no longer possible to import TIGER data because it relies on the location_road_2 table. We could be using the search_nametable instead in that case to look up the street. It will be quite a bit slower (maybe a temporary special index would help?) but at least it would work.

lonvia avatar Oct 09 '21 20:10 lonvia

Hello, I am new to this project and would like to participate! As this is declared as a good first issue, I would like to try out if I can contribute something. Can you maybe provide some hints where to look first and some guidance how to tackle this problem? Best regards, Christoph

ChristophTito avatar Jan 13 '22 16:01 ChristophTito

This concerns the implementation of the nominatim add-data --tiger-data. The basic implementation can be found innominatim/tools/tiger_data.py. However, to solve this issue, you have to dive a bit into the SQL functions. The main part of inserting the tiger data is done in the tiger_line_import function. Starting in line 73 there are three functions used getNearestNamedRoadPlaceId, getNearestParallelRoadFeature and getNearestRoadPlaceId. These three functions determine the closest road that should be used as the parent road. These function can be replaced with equivalent queries of search_name (for getNearestNamedRoadPlaceId) and placex (for the other two functions which need a geometry).

lonvia avatar Jan 20 '22 08:01 lonvia

Hello As i am new here i thought i could start by contributing to good first issues. As per the information provided by lonvia the link to the tiger_line_import function is not functional so can it be re-provided so i can look at the guidance material provided Thanks regards Pratham Saraf

pratham-saraf avatar Feb 24 '22 14:02 pratham-saraf