v0.2.50..v0.2.51 changeset OsmUtils.h
Garret Voltz edited this page Jan 15, 2020
·
1 revision
diff --git a/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.h b/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.h
index 772082c..315f724 100644
--- a/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.h
+++ b/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.h
@@ -283,16 +283,12 @@ public:
static long getFirstWayIdFromRelation(const ConstRelationPtr& relation, const OsmMapPtr& map);
/**
- * Logs a detailed printout for an element
+ * Constructs a detailed string for an element suitable for trace logging
*
- * @param element the element to log
+ * @param element the element to create a string for
* @param map map owning the element
- * @param logLevel granularity at which to log the element
- * @param message optional message
*/
- static void logElementDetail(const ConstElementPtr& element, const ConstOsmMapPtr& map,
- const Log::WarningLevel& logLevel = Log::Trace,
- const QString& message = "");
+ static QString getElementDetailString(const ConstElementPtr& element, const ConstOsmMapPtr& map);
/**
* Determines if two elements have conflicting one way street tags
@@ -462,8 +458,17 @@ public:
* Logs a warning if any element in the map has a changeset version less than one
*
* @param map the map to examine
+ * @return true if a warning was logged; false otherwise
*/
- static void checkVersionLessThanOneCountAndLogWarning(const OsmMapPtr& map);
+ static bool checkVersionLessThanOneCountAndLogWarning(const OsmMapPtr& map);
+
+ /**
+ * Returns the element IDs of all elements with a changeset version less than one
+ *
+ * @param map the map to examine
+ * @return a set of element IDs
+ */
+ static std::set<ElementId> getIdsOfElementsWithVersionLessThanOne(const OsmMapPtr& map);
/**
* Determines if a map contains only nodes that are not way nodes
@@ -574,6 +579,30 @@ public:
*/
static bool anyElementsHaveAnyKvp(const QStringList& kvps,
const std::set<ElementId>& elementIds, OsmMapPtr& map);
+
+ /**
+ * Determines if all element IDs in a map are positive
+ *
+ * @param map the map to examine
+ * @return true if all elements in the input map have a positive ID; false otherwise
+ */
+ static bool allElementIdsPositive(const ConstOsmMapPtr& map);
+
+ /**
+ * Determines if all element IDs in a map are negative
+ *
+ * @param map the map to examine
+ * @return true if all elements in the input map have a negative ID; false otherwise
+ */
+ static bool allElementIdsNegative(const ConstOsmMapPtr& map);
+
+ /**
+ * Determines if all hoot:id element tags in a map match their element IDs
+ *
+ * @param map the map to examine
+ * @return true if all the hoot:id tag values match the owning element's ID; false otherwise
+ */
+ static bool allIdTagsMatchIds(const ConstOsmMapPtr& map);
};
}