From 15b316b08ffd0786ede6f96c12d20454c807b001 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Tue, 24 Dec 2024 13:31:09 -0800 Subject: [PATCH 1/2] move ContainmentMode to h3api.h --- src/h3lib/include/h3api.h.in | 12 ++++++++++++ src/h3lib/include/polygon.h | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/h3lib/include/h3api.h.in b/src/h3lib/include/h3api.h.in index a6975a4d4..466762c1a 100644 --- a/src/h3lib/include/h3api.h.in +++ b/src/h3lib/include/h3api.h.in @@ -165,6 +165,18 @@ typedef struct { GeoPolygon *polygons; } GeoMultiPolygon; +/** + * Values representing polyfill containment modes, to be used in + * the `flags` bit field for `polygonToCellsExperimental`. + */ +typedef enum { + CONTAINMENT_CENTER = 0, ///< Cell center is contained in the shape + CONTAINMENT_FULL = 1, ///< Cell is fully contained in the shape + CONTAINMENT_OVERLAPPING = 2, ///< Cell overlaps the shape at any point + CONTAINMENT_OVERLAPPING_BBOX = 3, ///< Cell bounding box overlaps shape + CONTAINMENT_INVALID = 4 ///< This mode is invalid and should not be used +} ContainmentMode; + /** @struct LinkedLatLng * @brief A coordinate node in a linked geo structure, part of a linked list */ diff --git a/src/h3lib/include/polygon.h b/src/h3lib/include/polygon.h index b6fb37889..3aab8d943 100644 --- a/src/h3lib/include/polygon.h +++ b/src/h3lib/include/polygon.h @@ -40,18 +40,6 @@ /** Macro: Whether a GeoLoop is empty */ #define IS_EMPTY_GEOFENCE(geoloop) geoloop->numVerts == 0 -/** - * Values representing polyfill containment modes, to be used in - * the `flags` bit field. - */ -typedef enum { - CONTAINMENT_CENTER = 0, ///< Cell center is contained in the shape - CONTAINMENT_FULL = 1, ///< Cell is fully contained in the shape - CONTAINMENT_OVERLAPPING = 2, ///< Cell overlaps the shape at any point - CONTAINMENT_OVERLAPPING_BBOX = 3, ///< Cell bounding box overlaps shape - CONTAINMENT_INVALID = 4 ///< This mode is invalid and should not be used -} ContainmentMode; - // 1s in the 4 bits defining the polyfill containment mode, 0s elsewhere #define FLAG_CONTAINMENT_MODE_MASK ((uint32_t)(15)) #define FLAG_GET_CONTAINMENT_MODE(flags) (flags & FLAG_CONTAINMENT_MODE_MASK) From fdf1370c909953723e874452139a2e0d45379357 Mon Sep 17 00:00:00 2001 From: Isaac Brodsky Date: Tue, 24 Dec 2024 13:32:10 -0800 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9d430025..48520ceb9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ The public API of this library consists of the functions declared in file ## [Unreleased] +### Changed +- Moved `ContainmentMode` enum for `polygonToCellsExperimental` to `h3api.h`. (#958) + ## [4.2.0] - 2024-12-04 ### Added - Added experimental new algorithm for `polygonToCells`, called `polygonToCellsExperimental`, that supports more containment flags and is more memory-efficient (#785, #800, #947)