Skip to content

Commit

Permalink
also add option --no-untagged-areas for completeness
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbr committed Nov 26, 2024
1 parent c9a59e8 commit 19e6a3b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/osm2rdf/config/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ const static inline std::string NO_UNTAGGED_RELATIONS_OPTION_LONG =
const static inline std::string NO_UNTAGGED_RELATIONS_OPTION_HELP =
"Do not output untagged relations";

const static inline std::string NO_UNTAGGED_AREAS_INFO =
"Do not output untagged areas";
const static inline std::string NO_UNTAGGED_AREAS_OPTION_SHORT = "";
const static inline std::string NO_UNTAGGED_AREAS_OPTION_LONG =
"no-untagged-areas";
const static inline std::string NO_UNTAGGED_AREAS_OPTION_HELP =
"Do not output untagged areas";

const static inline std::string ADD_AREA_WAY_LINESTRINGS_INFO =
"Adding linestrings for ways which form areas";
const static inline std::string ADD_AREA_WAY_LINESTRINGS_OPTION_SHORT = "";
Expand Down
11 changes: 11 additions & 0 deletions src/config/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ std::string osm2rdf::config::Config::getInfo(std::string_view prefix) const {
oss << "\n"
<< prefix << osm2rdf::config::constants::NO_UNTAGGED_RELATIONS_INFO;
}
if (!addUntaggedAreas) {
oss << "\n"
<< prefix << osm2rdf::config::constants::NO_UNTAGGED_AREAS_INFO;
}
if (simplifyWKT > 0) {
oss << "\n" << prefix << osm2rdf::config::constants::SIMPLIFY_WKT_INFO;
oss << "\n"
Expand Down Expand Up @@ -294,6 +298,12 @@ void osm2rdf::config::Config::fromArgs(int argc, char** argv) {
osm2rdf::config::constants::NO_UNTAGGED_RELATIONS_OPTION_LONG,
osm2rdf::config::constants::NO_UNTAGGED_RELATIONS_OPTION_HELP);

auto noUntaggedAreasOp =
parser.add<popl::Switch, popl::Attribute::expert>(
osm2rdf::config::constants::NO_UNTAGGED_AREAS_OPTION_SHORT,
osm2rdf::config::constants::NO_UNTAGGED_AREAS_OPTION_LONG,
osm2rdf::config::constants::NO_UNTAGGED_AREAS_OPTION_HELP);

auto addWayMetadataOp = parser.add<popl::Switch>(
osm2rdf::config::constants::ADD_WAY_METADATA_OPTION_SHORT,
osm2rdf::config::constants::ADD_WAY_METADATA_OPTION_LONG,
Expand Down Expand Up @@ -475,6 +485,7 @@ void osm2rdf::config::Config::fromArgs(int argc, char** argv) {
addUntaggedNodes = !noUntaggedNodesOp->is_set();
addUntaggedWays = !noUntaggedWaysOp->is_set();
addUntaggedRelations = !noUntaggedRelationsOp->is_set();
addUntaggedAreas = !noUntaggedAreasOp->is_set();

addWayNodeOrder |= addWayNodeSpatialMetadata;

Expand Down

0 comments on commit 19e6a3b

Please sign in to comment.