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

      This is useful when you have the polyhedron stored as GeoTriangles (e.g., from a database) and want to test containment without first converting to BufferGeometry.

      Parameters

      • coords: Coords

        The geographic coordinates to test

      • triangles: GeoTriangle[]

        Array of GeoTriangle objects defining the closed surface

      • origin: Coords

        The geographic origin used for coordinate conversion

      Returns PointInPolyhedronResult

      A PointInPolyhedronResult with the test result

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

      // Triangles loaded from database
      const triangles = JSON.parse(storedGeoJson);
      const origin = { latitude: 51.5074, longitude: -0.1278, altitude: 0 };
      const testPoint = { latitude: 51.5080, longitude: -0.1270, altitude: 25 };

      const result = isCoordsInGeoTriangles(testPoint, triangles, origin);