Skip to content

v0.2.48..v0.2.49 changeset OsmUtils.h

Garret Voltz edited this page Oct 2, 2019 · 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 1123f8d..2c176ef 100644
--- a/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.h
+++ b/hoot-core/src/main/cpp/hoot/core/elements/OsmUtils.h
@@ -355,6 +355,104 @@ public:
    */
   static bool nodeContainedByAnyWay(const long nodeId, const std::set<long> wayIds,
                                     const ConstOsmMapPtr& map);
+
+  /**
+   * Determines if a node is contained by any way in a map
+   *
+   * @param nodeId the ID of the node to search for
+   * @param map the map containing the nodes/ways
+   * @return true if any way in the map contains the node; false otherwise
+   */
+  static bool nodeContainedByAnyWay(const long nodeId, const ConstOsmMapPtr& map);
+
+  /**
+   * Determines if an element is contained by any relation in a map
+   *
+   * @param elementId the ID of the element to search for
+   * @param map the map containing the element
+   * @return true if any relation in the map contains the element; false otherwise
+   */
+  static bool elementContainedByAnyRelation(const ElementId& elementId, const ConstOsmMapPtr& map);
+
+  /**
+   * Determines if an element is contained by any way or relation in a map
+   *
+   * @param elementId the ID of the element to search for
+   * @param map the map containing the element
+   * @return true if any way or relation in the map contains the element; false otherwise
+   */
+  static bool isChild(const ElementId& elementId, const ConstOsmMapPtr& map);
+
+  /**
+   * Returns the number of elements with a changeset version less than one
+   *
+   * @param map the map to examine
+   * @return the number of elements meeting the criteria
+   */
+  static int versionLessThanOneCount(const OsmMapPtr& map);
+
+  /**
+   * Logs a warning if any element in the map has a changeset version less than one
+   *
+   * @param map the map to examine
+   */
+  static void checkVersionLessThanOneCountAndLogWarning(const OsmMapPtr& map);
+
+  /**
+   * Determines if a map contains only nodes that are not way nodes
+   *
+   * @param map the map to examine
+   * @return true if the map is made up of non-way node points only; false otherwise
+   */
+  static bool mapIsPointsOnly(const OsmMapPtr& map);
+
+  /**
+   * Determines if all elements in a specified collection have any tag key from a specified set of
+   * keys
+   *
+   * @param tagKeys the tag keys to search for
+   * @param elements the elements to examine
+   * @return true if all elements from the input collection of elements contain at least one of the
+   * tag keys specified in tagKeys; false otherwise
+   */
+  static bool allElementsHaveAnyTagKey(const QStringList& tagKeys,
+                                       const std::vector<ElementPtr>& elements);
+
+  /**
+   * Determines if all elements in a specified collection have any tag key/value pair from a
+   * specified set of kvps
+   *
+   * @param kvp the tag key/value pairs to search for
+   * @param elements the elements to examine
+   * @return true if all elements from the input collection of elements contain at least one of the
+   * key/value pairs specified in kvps; false otherwise
+   */
+  static bool allElementsHaveAnyKvp(const QStringList& kvps,
+                                    const std::vector<ElementPtr>& elements);
+
+  /**
+   * Determines if any elements in a specified collection have any tag key from a specified set of
+   * keys
+   *
+   * @param tagKeys the tag keys to search for
+   * @param elements the elements to examine
+   * @return true if any elements from the input collection of elements contain at least one of the
+   * tag keys specified in tagKeys; false otherwise
+   */
+  static bool anyElementsHaveAnyTagKey(const QStringList& tagKeys,
+                                       const std::vector<ElementPtr>& elements);
+
+  /**
+   * Determines if any elements in a specified collection have any tag key/value pair from a
+   * specified set of kvps
+   *
+   * @param kvps the tag key/value pairs to search for
+   * @param elements the elements to examine
+   * @return true if any elements from the input collection of elements contain at least one of the
+   * key/value pairs specified in kvps; false otherwise
+   */
+  static bool anyElementsHaveAnyKvp(const QStringList& kvps,
+                                    const std::vector<ElementPtr>& elements);
 };
 
 }
Clone this wiki locally