some variables renamed to replace camel case
This commit is contained in:
parent
0325861ef3
commit
7f2daf8926
@ -298,8 +298,8 @@ inline void PBFParser::parseRelation(ParserThreadData *thread_data)
|
|||||||
std::string except_tag_string;
|
std::string except_tag_string;
|
||||||
const OSMPBF::Relation &inputRelation =
|
const OSMPBF::Relation &inputRelation =
|
||||||
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID).relations(i);
|
thread_data->PBFprimitiveBlock.primitivegroup(thread_data->currentGroupID).relations(i);
|
||||||
bool isRestriction = false;
|
bool is_restriction = false;
|
||||||
bool isOnlyRestriction = false;
|
bool is_only_restriction = false;
|
||||||
for (int k = 0, endOfKeys = inputRelation.keys_size(); k < endOfKeys; ++k)
|
for (int k = 0, endOfKeys = inputRelation.keys_size(); k < endOfKeys; ++k)
|
||||||
{
|
{
|
||||||
const std::string &key =
|
const std::string &key =
|
||||||
@ -310,7 +310,7 @@ inline void PBFParser::parseRelation(ParserThreadData *thread_data)
|
|||||||
{
|
{
|
||||||
if ("restriction" == val)
|
if ("restriction" == val)
|
||||||
{
|
{
|
||||||
isRestriction = true;
|
is_restriction = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -319,7 +319,7 @@ inline void PBFParser::parseRelation(ParserThreadData *thread_data)
|
|||||||
}
|
}
|
||||||
if (("restriction" == key) && (val.find("only_") == 0))
|
if (("restriction" == key) && (val.find("only_") == 0))
|
||||||
{
|
{
|
||||||
isOnlyRestriction = true;
|
is_only_restriction = true;
|
||||||
}
|
}
|
||||||
if ("except" == key)
|
if ("except" == key)
|
||||||
{
|
{
|
||||||
@ -327,15 +327,15 @@ inline void PBFParser::parseRelation(ParserThreadData *thread_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRestriction && ShouldIgnoreRestriction(except_tag_string))
|
if (is_restriction && ShouldIgnoreRestriction(except_tag_string))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isRestriction)
|
if (is_restriction)
|
||||||
{
|
{
|
||||||
int64_t lastRef = 0;
|
int64_t lastRef = 0;
|
||||||
InputRestrictionContainer currentRestrictionContainer(isOnlyRestriction);
|
InputRestrictionContainer current_restriction_container(is_only_restriction);
|
||||||
for (int rolesIndex = 0, last_role = inputRelation.roles_sid_size();
|
for (int rolesIndex = 0, last_role = inputRelation.roles_sid_size();
|
||||||
rolesIndex < last_role;
|
rolesIndex < last_role;
|
||||||
++rolesIndex)
|
++rolesIndex)
|
||||||
@ -357,27 +357,27 @@ inline void PBFParser::parseRelation(ParserThreadData *thread_data)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
assert("via" == role);
|
assert("via" == role);
|
||||||
if (std::numeric_limits<unsigned>::max() != currentRestrictionContainer.viaNode)
|
if (std::numeric_limits<unsigned>::max() != current_restriction_container.viaNode)
|
||||||
{
|
{
|
||||||
currentRestrictionContainer.viaNode = std::numeric_limits<unsigned>::max();
|
current_restriction_container.viaNode = std::numeric_limits<unsigned>::max();
|
||||||
}
|
}
|
||||||
assert(std::numeric_limits<unsigned>::max() == currentRestrictionContainer.viaNode);
|
assert(std::numeric_limits<unsigned>::max() == current_restriction_container.viaNode);
|
||||||
currentRestrictionContainer.restriction.viaNode = lastRef;
|
current_restriction_container.restriction.viaNode = lastRef;
|
||||||
break;
|
break;
|
||||||
case 1: // way
|
case 1: // way
|
||||||
assert("from" == role || "to" == role || "via" == role);
|
assert("from" == role || "to" == role || "via" == role);
|
||||||
if ("from" == role)
|
if ("from" == role)
|
||||||
{
|
{
|
||||||
currentRestrictionContainer.fromWay = lastRef;
|
current_restriction_container.fromWay = lastRef;
|
||||||
}
|
}
|
||||||
if ("to" == role)
|
if ("to" == role)
|
||||||
{
|
{
|
||||||
currentRestrictionContainer.toWay = lastRef;
|
current_restriction_container.toWay = lastRef;
|
||||||
}
|
}
|
||||||
if ("via" == role)
|
if ("via" == role)
|
||||||
{
|
{
|
||||||
assert(currentRestrictionContainer.restriction.toNode == std::numeric_limits<unsigned>::max());
|
assert(current_restriction_container.restriction.toNode == std::numeric_limits<unsigned>::max());
|
||||||
currentRestrictionContainer.viaNode = lastRef;
|
current_restriction_container.viaNode = lastRef;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2: // relation, not used. relations relating to relations are evil.
|
case 2: // relation, not used. relations relating to relations are evil.
|
||||||
@ -390,7 +390,7 @@ inline void PBFParser::parseRelation(ParserThreadData *thread_data)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!extractor_callbacks->ProcessRestriction(currentRestrictionContainer))
|
if (!extractor_callbacks->ProcessRestriction(current_restriction_container))
|
||||||
{
|
{
|
||||||
std::cerr << "[PBFParser] relation not parsed" << std::endl;
|
std::cerr << "[PBFParser] relation not parsed" << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user