From dab22c54592f006a6ce1083e624b456dd9cd53f1 Mon Sep 17 00:00:00 2001 From: Jochen Topf Date: Fri, 26 Jan 2024 16:52:00 +0100 Subject: [PATCH] Switch middle database default format to "new" --- man/osm2pgsql.md | 11 +++++------ src/command-line-parser.cpp | 4 ++-- src/options.hpp | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/man/osm2pgsql.md b/man/osm2pgsql.md index 17869eb9c..d7e170407 100644 --- a/man/osm2pgsql.md +++ b/man/osm2pgsql.md @@ -179,12 +179,11 @@ mandatory for short options too. \--middle-database-format=FORMAT : Set the database format for the middle tables to FORMAT. Allowed formats - are **legacy** and **new**. The **legacy** format is the old format that - will eventually be deprecated and removed but is currently still the - default. The **new** format was introduced in version 1.9.0. - See the manual for details on these formats. (Only works - with **\--slim**. In append mode osm2pgsql will automatically detect the - database format, so don't use this with **-a, \--append**.) + are **new** (default) and **legacy** . The **legacy** format is deprecated + and will be removed in version 2.0.0. See the manual for details on these + formats. (Only works with **\--slim**. In append mode osm2pgsql will + automatically detect the database format, so don't use this with + **-a, \--append**.) \--middle-with-nodes : Used together with the **new** middle database format when a flat nodes diff --git a/src/command-line-parser.cpp b/src/command-line-parser.cpp index 11b545d4b..2e4fa59fb 100644 --- a/src/command-line-parser.cpp +++ b/src/command-line-parser.cpp @@ -221,7 +221,7 @@ static void check_options(options_t *options) throw std::runtime_error{"--drop only makes sense with --slim."}; } - if (options->append && options->middle_database_format != 1) { + if (options->append && options->middle_database_format != 2) { throw std::runtime_error{ "Do not use --middle-database-format with --append."}; } @@ -550,7 +550,7 @@ options_t parse_command_line(int argc, char *argv[]) " (Use 'legacy' or 'new')."}; } }) - ->description("Set middle db format ('legacy' (default), 'new').") + ->description("Set middle db format ('legacy', 'new' (default)).") ->type_name("FORMAT") ->group("Middle options"); diff --git a/src/options.hpp b/src/options.hpp index 458927d95..9bdb09954 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -116,7 +116,7 @@ struct options_t uint8_t way_node_index_id_shift = 5; /// Database format (0=unknown/no database middle, 1=legacy, 2=new) - uint8_t middle_database_format = 1; + uint8_t middle_database_format = 2; /** * Should nodes (with tags) be stored in the middle? If no flat node file