geo_fence_utils 1.0.0 copy "geo_fence_utils: ^1.0.0" to clipboard
geo_fence_utils: ^1.0.0 copied to clipboard

A production-ready Dart package for geofence calculations. Features accurate distance calculation using Haversine formula, circle and polygon geofence detection, batch operations, and comprehensive testing.

Changelog #

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

1.0.0 - 2026-03-03 #

Added #

  • Initial release of geo_fence_utils package
  • GeoPoint model with latitude/longitude validation
  • GeoCircle model with area and circumference calculations
  • GeoPolygon model with vertex count, centroid, and convexity detection
  • GeoDistanceService for distance calculations using Haversine formula
  • GeoCircleService for circle-based geofence detection
  • GeoPolygonService for polygon-based geofence detection using Ray Casting
  • Custom exception classes:
    • GeoException base exception
    • InvalidRadiusException for invalid radius values
    • InvalidPolygonException for invalid polygon structures
    • InvalidCoordinateException for invalid coordinates
    • GeoCalculationException for calculation failures

Features #

Distance Calculations

  • Great-circle distance calculation using Haversine formula
  • Batch distance calculations
  • Find closest/farthest points
  • Sort points by distance
  • Filter points by radius
  • Check if points are within distance threshold

Circle Geofence

  • Point-in-circle detection
  • Point-on-boundary detection with configurable tolerance
  • Distance to boundary calculation (positive=outside, negative=inside)
  • Batch operations: filter inside/outside, count
  • Percentage calculation for point sets
  • Circle overlap detection
  • Circle containment check

Polygon Geofence

  • Point-in-polygon detection using Ray Casting algorithm
  • Point-on-boundary detection
  • Polygon validation
  • Convexity detection
  • Batch operations: filter inside/outside, count
  • Area calculation
  • Perimeter calculation
  • Bounding box calculation
  • Optimized containment check using bounding box

Utility Functions

  • Degree/radian conversions
  • Bearing calculations
  • Destination point calculation
  • Midpoint calculation
  • Planar distance approximation

Testing #

  • Comprehensive test suite with 187 tests
  • 96.044% code coverage (437/455 lines)
  • Unit tests for all models and services
  • Integration tests for real-world scenarios
  • Edge case tests (poles, antipodal points, date line)

Documentation #

  • Comprehensive README with examples
  • API reference for all public methods
  • Performance characteristics
  • Accuracy specifications
  • Use case examples
13
likes
0
points
260
downloads

Publisher

verified publishermnbtechhube.com

Weekly Downloads

A production-ready Dart package for geofence calculations. Features accurate distance calculation using Haversine formula, circle and polygon geofence detection, batch operations, and comprehensive testing.

Repository (GitHub)
View/report issues

Topics

#geography #geolocation #geofencing #maps #distance

Documentation

Documentation

License

unknown (license)

Dependencies

flutter

More

Packages that depend on geo_fence_utils