diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/HighwayCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/HighwayCriterion.cpp
index dd9e35f..f5882de 100644
--- a/hoot-core/src/main/cpp/hoot/core/criterion/HighwayCriterion.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/criterion/HighwayCriterion.cpp
@@ -41,6 +41,7 @@ HOOT_FACTORY_REGISTER(ElementCriterion, HighwayCriterion)
bool HighwayCriterion::isSatisfied(const ConstElementPtr& element) const
{
LOG_VART(element->getElementId());
+ //LOG_VART(element);
const ElementType type = element->getElementType();
@@ -54,15 +55,15 @@ bool HighwayCriterion::isSatisfied(const ConstElementPtr& element) const
const Tags& tags = element->getTags();
Tags::const_iterator it = tags.find("highway");
+ const bool containsHighwayTag = it != tags.end() && it.value() != "";
// Is it a legit highway?
- if ((type == ElementType::Way || type == ElementType::Relation) &&
- it != tags.end() && it.value() != "")
+ if ((type == ElementType::Way || type == ElementType::Relation) && containsHighwayTag)
{
result = true;
LOG_VART(result);
}
- // Make sure it isn't a building or a part of a building
+ // Make sure it isn't a building or a part of a building.
else if (_map && (BuildingCriterion(_map).isSatisfied(element) ||
BuildingCriterion(_map).isParentABuilding(element->getElementId())))
{
@@ -81,7 +82,7 @@ bool HighwayCriterion::isSatisfied(const ConstElementPtr& element) const
LOG_VART(result);
}
- LOG_VART(result);
+ LOG_TRACE(element->getElementId() << " result: " << result);
return result;
}