Skip to content

Commit

Permalink
Ignore nodes in ways with --skip-integrity (#469) (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
systemed authored Mar 7, 2023
1 parent 571a997 commit 334a99f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/osm_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ class OSMStore

void use_compact_store(bool use = true) { use_compact_nodes = use; }
void enforce_integrity(bool ei = true) { require_integrity = ei; }
bool integrity_enforced() { return require_integrity; }

void shapes_sort(unsigned int threadNum = 1);
void generated_sort(unsigned int threadNum = 1);
Expand Down
6 changes: 5 additions & 1 deletion src/read_pbf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ bool PbfReader::ReadWays(OsmLuaProcessing &output, PrimitiveGroup &pg, Primitive
int64_t nodeId = 0;
for (int k=0; k<pbfWay.refs_size(); k++) {
nodeId += pbfWay.refs(k);
llVec.push_back(osmStore.nodes_at(static_cast<NodeID>(nodeId)));
try {
llVec.push_back(osmStore.nodes_at(static_cast<NodeID>(nodeId)));
} catch (std::out_of_range &err) {
if (osmStore.integrity_enforced()) throw err;
}
}
}

Expand Down

0 comments on commit 334a99f

Please sign in to comment.