The geographic coordinates to test
Array of GeoTriangle objects defining the closed surface
The geographic origin used for coordinate conversion
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);
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.