diff --git a/Demos/src/LocationLookup.cpp b/Demos/src/LocationLookup.cpp index 0492d65cc..774d00d36 100644 --- a/Demos/src/LocationLookup.cpp +++ b/Demos/src/LocationLookup.cpp @@ -378,7 +378,7 @@ int main(int argc, char* argv[]) args.repeat=value; }), "repeat", - "Cout of repeat for performance test"); + "Count of repeat for performance test"); argParser.AddOption(osmscout::CmdLineFlag([&args](const bool& value) { args.transliterate=value; @@ -435,7 +435,7 @@ int main(int argc, char* argv[]) } osmscout::DatabaseParameter databaseParameter; - osmscout::DatabaseRef database(new osmscout::Database(databaseParameter)); + osmscout::DatabaseRef database=std::make_shared(databaseParameter); if (!database->Open(args.databaseDirectory)) { std::cerr << "Cannot open db" << std::endl; diff --git a/libosmscout/src/osmscout/location/LocationService.cpp b/libosmscout/src/osmscout/location/LocationService.cpp index 946692bdf..5431de31a 100644 --- a/libosmscout/src/osmscout/location/LocationService.cpp +++ b/libosmscout/src/osmscout/location/LocationService.cpp @@ -1088,7 +1088,7 @@ namespace osmscout { * @param tokenString * Token to remove * @param tokens - * List to rmeove token parameter from + * List to remove token parameter from * @return * New list */ @@ -1379,9 +1379,19 @@ namespace osmscout { locationIgnoreTokenSet.insert(UTF8StringToUpper(token)); } + // Locations are streets in town usually. But for small villages without named streets, + // village name (region) is added as virtual location to our location index. + // Address points are linked by "addr:place" tag to the place (region). + // + // So, to be able lookup address points just by phrase "Village 123", + // we add region name to location search patterns. + // We would force users to use pattern "Village Village 123" otherwise. + std::list extendedLocationTokens=locationTokens; + extendedLocationTokens.push_back(regionMatch.name); + // Build Location search patterns - std::list locationSearchPatterns=GenerateSearchPatterns(locationTokens, + std::list locationSearchPatterns=GenerateSearchPatterns(extendedLocationTokens, locationIgnoreTokenSet, locationIndex->GetLocationMaxWords());