h3_flutter_gdx_plus 0.8.2 copy "h3_flutter_gdx_plus: ^0.8.2" to clipboard
h3_flutter_gdx_plus: ^0.8.2 copied to clipboard

Android and iOS Flutter bindings for the H3 Core hexagonal geospatial indexing library.

h3_flutter_gdx_plus #

Build & Test License: Apache 2.0

Android and iOS Flutter bindings for Uber's H3 hexagonal hierarchical geospatial indexing system.

This package preserves the API of the original h3_flutter package. It uses h3_ffi to call the native H3 library.

Features #

  • Convert geographic coordinates to and from H3 cell indexes.
  • Query neighboring cells, rings, paths, boundaries, parents, and children.
  • Fill polygons with H3 cells and work with compacted cell sets.
  • Calculate cell areas, edge lengths, distances, and local IJ coordinates.
  • Convert between H3 cells and GeoJSON features with the bundled geojson2h3 helpers.
  • Use one Flutter API across Android and iOS.

Compatibility #

Component Supported version
Dart SDK >=3.5.0 <4.0.0
Flutter >=3.24.0
H3 Core 4.2.1
Platforms Android, iOS

Both supported platforms link the H3 C library through FFI. The minimum iOS deployment target is 13.0.

Installation #

Add the maintained package to your application:

flutter pub add h3_flutter_gdx_plus

Or add it to pubspec.yaml:

dependencies:
  h3_flutter_gdx_plus: ^0.8.2

Import the package:

import 'package:h3_flutter_gdx_plus/h3_flutter_gdx_plus.dart';

Usage #

Load H3 and fill a triangle with resolution 5 cells:

import 'package:h3_flutter_gdx_plus/h3_flutter_gdx_plus.dart';

final h3 = const H3Factory().load();

final cells = h3.polyfill(
  resolution: 5,
  coordinates: [
    GeoCoord(20.4522, 54.7104),
    GeoCoord(37.6173, 55.7558),
    GeoCoord(39.7015, 47.2357),
  ],
);

GeoJSON conversion helpers are available through Geojson2H3:

final geojson2h3 = Geojson2H3(h3);
final featureCollection = geojson2h3.h3SetToFeatureCollection(cells);

These helpers are a Dart port of Uber's original Geojson2H3 project and use package:geojson2h3 internally.

Platform setup #

No application-side native setup is required when installing the package from pub.dev. The plugin links the native H3 library automatically on Android and iOS. iOS projects can use either Swift Package Manager or CocoaPods. Other Flutter platforms are not supported by this maintained package.

Example #

The example application demonstrates package initialization and can be run on Android or iOS:

cd example
flutter pub get
flutter run

Contributing #

Read the repository's contribution guide before opening a change.

The prebuilt iOS XCFramework is committed so pub.dev and Git-based dependencies work without application-side build steps. Rebuild and commit it whenever the bundled H3 source is updated:

bindings/scripts/build_darwin_static_lib.sh

When upgrading H3, update and validate h3_ffi first, then run the example and tests on Android and iOS. Synchronize the Android source bundle after updating the H3 submodule:

bindings/scripts/toggle_h3lib.sh

Maintained Package #

h3_flutter_gdx_plus is a community-maintained continuation of festelo/h3_dart, whose upstream maintenance is currently inactive. The original project history, Apache 2.0 license, author credit, and contributor acknowledgements remain intact.

This fork provides ongoing compatibility, release, and issue maintenance without claiming authorship of the original work.

Acknowledgements #

The original h3_flutter package and the wider h3_dart project were created and maintained by Ilia (Ilya) Beregovskii / festelo. Thanks to all upstream contributors, including the contributors credited throughout the preserved changelogs.

This package builds on the open-source Uber H3, geojson2h3 projects. The bundled H3 attribution is preserved in NOTICE.

Feature Requests #

Feature requests and Pull Requests are always welcome. For defects, open a bug report.

Need Help? #

Need help with H3 integration, Flutter development, consulting, or ongoing plugin maintenance? Get in touch to discuss your requirements:

Maintainer #

Maintained by Gurwinder Singh, founder of Gurwinder DevX.

0
likes
160
points
218
downloads

Documentation

API reference

Publisher

verified publishergurwinderdevx.com

Weekly Downloads

Android and iOS Flutter bindings for the H3 Core hexagonal geospatial indexing library.

Homepage
Repository (GitHub)
View/report issues
Contributing

Funding

Consider supporting this project:

buymeacoffee.com

License

Apache-2.0 (license)

Dependencies

flutter, geojson2h3, h3_common, h3_ffi

More

Packages that depend on h3_flutter_gdx_plus

Packages that implement h3_flutter_gdx_plus