Fix merge error in linkedGeo.c
@@ -127,6 +127,50 @@ void H3_EXPORT(destroyLinkedPolygon)(LinkedGeoPolygon* polygon) {
}
}
+/**
+ * Count the number of polygons in a linked list
+ * @param polygon Starting polygon
+ * @return Count
+ */
+int countLinkedPolygons(LinkedGeoPolygon* polygon) {
+ int count = 0;
+ while (polygon != NULL) {
+ count++;
+ polygon = polygon->next;
+ }
+ return count;
+}
+
+/**
+ * Count the number of linked loops in a polygon
+ * @param polygon Polygon to count loops for
+ * @return Count
+ */
+int countLinkedLoops(LinkedGeoPolygon* polygon) {
+ LinkedGeoLoop* loop = polygon->first;
+ int count = 0;
+ while (loop != NULL) {
+ count++;
+ loop = loop->next;
+ }
+ return count;
+}
+
+/**
+ * Count the number of coordinates in a loop
+ * @param loop Loop to count coordinates for
+ * @return Count
+ */
+int countLinkedCoords(LinkedGeoLoop* loop) {
+ LinkedGeoCoord* coord = loop->first;
+ int count = 0;
+ while (coord != NULL) {
+ count++;
+ coord = coord->next;
+ }
+ return count;
+}
+
/**
* Count the number of polygons containing a given loop.
* @param loop Loop to count containers for
