From a357df617a5b7ce6d7e0590967bceba16e90c333 Mon Sep 17 00:00:00 2001 From: Tim Teulings Date: Sun, 8 Oct 2023 09:02:24 +0200 Subject: [PATCH] Improvement: See issue #1506 Add options "--areaWayIndexMinMag" and "--areaWayIndexMaxMag" --- Import/src/Import.cpp | 33 +++++++++++++++++++ .../include/osmscoutimport/ImportParameter.h | 2 -- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/Import/src/Import.cpp b/Import/src/Import.cpp index 9bc43145c..f4ef7d4f0 100644 --- a/Import/src/Import.cpp +++ b/Import/src/Import.cpp @@ -125,6 +125,9 @@ void DumpHelp(osmscout::ImportParameter& parameter) std::cout << " --wayDataMemoryMaped true|false memory maped way data file access (default: " << osmscout::BoolToString(parameter.GetWayDataMemoryMaped()) << ")" << std::endl; std::cout << " --wayDataCacheSize way data cache size (default: " << parameter.GetWayDataCacheSize() << ")" << std::endl; + std::cout << " --areaWayIndexMinMag minimum index level for area way index analysis (default: " << parameter.GetAreaWayIndexMinMag() << ")" << std::endl; + std::cout << " --areaWayIndexMaxMag maximum index level for area way index analysis (default: " << parameter.GetAreaWayIndexMaxMag() << ")" << std::endl; + std::cout << " --routeNodeBlockSize number of route nodes resolved in block (default: " << parameter.GetRouteNodeBlockSize() << ")" << std::endl; std::cout << std::endl; std::cout << " --langOrder <#|lang1[,#|lang2]..> language order when parsing lang[:language] and place_name[:language] tags" << std::endl @@ -349,6 +352,10 @@ static void DumpParameter(const osmscout::ImportParameter& parameter, (parameter.GetAreaDataMemoryMaped() ? "true" : "false")); progress.Info(std::string("AreaDataCacheSize: ")+ std::to_string(parameter.GetAreaDataCacheSize())); + progress.Info(std::string("AreaWayIndexMinMag: ")+ + std::to_string(parameter.GetAreaWayIndexMinMag().Get())); + progress.Info(std::string("AreaWayIndexMaxMag: ")+ + std::to_string(parameter.GetAreaWayIndexMaxMag().Get())); progress.Info(std::string("WayDataMemoryMaped: ")+ (parameter.GetWayDataMemoryMaped() ? "true" : "false")); @@ -810,6 +817,32 @@ int main(int argc, char* argv[]) parameterError=true; } } + else if (strcmp(argv[i],"--areaWayIndexMinMag")==0) { + size_t areaWayIndexMinMag; + + if (osmscout::ParseSizeTArgument(argc, + argv, + i, + areaWayIndexMinMag)) { + parameter.SetAreaWayIndexMinMag(osmscout::MagnificationLevel(areaWayIndexMinMag)); + } + else { + parameterError=true; + } + } + else if (strcmp(argv[i],"--areaWayIndexMaxMag")==0) { + size_t areaWayIndexMaxMag; + + if (osmscout::ParseSizeTArgument(argc, + argv, + i, + areaWayIndexMaxMag)) { + parameter.SetAreaWayIndexMaxMag(osmscout::MagnificationLevel(areaWayIndexMaxMag)); + } + else { + parameterError=true; + } + } else if (strcmp(argv[i],"--wayDataMemoryMaped")==0) { bool wayDataMemoryMaped; diff --git a/libosmscout-import/include/osmscoutimport/ImportParameter.h b/libosmscout-import/include/osmscoutimport/ImportParameter.h index 10907cbac..249a51153 100644 --- a/libosmscout-import/include/osmscoutimport/ImportParameter.h +++ b/libosmscout-import/include/osmscoutimport/ImportParameter.h @@ -374,8 +374,6 @@ class OSMSCOUT_IMPORT_API ImportParameter CLASS_FINAL std::unique_ptr GetPreprocessor(const std::string& filename, PreprocessorCallback& callback) const; - void SetAreaWayIndexMaxMag(const MagnificationLevel& areaWayIndexMaxLevel); - void SetTextIndexVariant(TextIndexVariant textIndexVariant); TextIndexVariant GetTextIndexVariant() const;