React Three Map - v1.0.9
    Preparing search index...
    • Tests whether a geographic coordinate is inside a geo-polyhedron.

      This is the geographic version of isPointInPolyhedron, accepting coordinates in latitude/longitude/altitude format.

      Parameters

      • coords: Coords

        The geographic coordinates to test

      • geometry: BufferGeometry

        The BufferGeometry representing the closed polyhedron (in 3D space relative to origin)

      • origin: Coords

        The geographic origin used for coordinate conversion

      Returns PointInPolyhedronResult

      A PointInPolyhedronResult with the test result

      import { isCoordsInPolyhedron } from '@wendylabsinc/react-three-map/maplibre';

      const origin = { latitude: 51.5074, longitude: -0.1278, altitude: 0 };
      const testPoint = { latitude: 51.5080, longitude: -0.1270, altitude: 25 };

      const result = isCoordsInPolyhedron(testPoint, geofenceGeometry, origin);
      if (result.inside) {
      console.log('Point is inside the geofence');
      }