Skip to content

Commit

Permalink
Switch middle database default format to "new"
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Feb 4, 2024
1 parent 68eae3f commit dab22c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions man/osm2pgsql.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/command-line-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."};
}
Expand Down Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion src/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dab22c5

Please sign in to comment.