-
Notifications
You must be signed in to change notification settings - Fork 74
v0.2.52..v0.2.53 changeset PoiPolygonPoiCriterion.cpp
Garret Voltz edited this page Feb 12, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.cpp b/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.cpp
index 1aa6ce6..2069388 100644
--- a/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/criterion/poi-polygon/PoiPolygonPoiCriterion.cpp
@@ -22,7 +22,7 @@
* This will properly maintain the copyright information. DigitalGlobe
* copyrights will be updated automatically.
*
- * @copyright Copyright (C) 2015, 2017, 2018, 2019 DigitalGlobe (http://www.digitalglobe.com/)
+ * @copyright Copyright (C) 2015, 2017, 2018, 2019, 2020 DigitalGlobe (http://www.digitalglobe.com/)
*/
#include "PoiPolygonPoiCriterion.h"
@@ -51,6 +51,12 @@ bool PoiPolygonPoiCriterion::isSatisfied(const ConstElementPtr& e) const
{
const Tags& tags = e->getTags();
+ const bool isNode = e->getElementType() == ElementType::Node;
+ if (!isNode)
+ {
+ return false;
+ }
+
//see note in PoiPolygonPolyCriterion::isSatisified
if (OsmSchema::getInstance().containsTagFromList(tags, _tagIgnoreList))
{
@@ -59,20 +65,21 @@ bool PoiPolygonPoiCriterion::isSatisfied(const ConstElementPtr& e) const
}
LOG_TRACE("Does not contain tag from tag ignore list");
- const bool isNode = e->getElementType() == ElementType::Node;
- if (!isNode)
+ LOG_VART(tags.getNames());
+ bool isPoi = false;
+ if (tags.getNames().size() > 0)
{
- return false;
+ isPoi = true;
+ }
+ else
+ {
+ // TODO: should "use" be added as a category here?
+ const bool inABuildingOrPoiCategory =
+ OsmSchema::getInstance().getCategories(tags)
+ .intersects(OsmSchemaCategory::building() | OsmSchemaCategory::poi());
+ isPoi = inABuildingOrPoiCategory;
+ LOG_VART(inABuildingOrPoiCategory);
}
-
- // TODO: should use be added as a category here?
- const bool inABuildingOrPoiCategory =
- OsmSchema::getInstance().getCategories(tags)
- .intersects(OsmSchemaCategory::building() | OsmSchemaCategory::poi());
- bool isPoi = isNode && (inABuildingOrPoiCategory || tags.getNames().size() > 0);
- LOG_VART(inABuildingOrPoiCategory);
- LOG_VART(tags.get("uuid"));
- LOG_VART(tags.getNames());
LOG_VART(isPoi);
if (!isPoi && ConfigOptions().getPoiPolygonPromotePointsWithAddressesToPois())