React Three Map - v1.0.9
    Preparing search index...
    • Parses a PostGIS POLYHEDRALSURFACE Z WKT string and converts it to a BufferGeometry.

      Parameters

      • wkt: string

        The WKT string in POLYHEDRALSURFACE Z format

      • options: WKTToBufferGeometryOptions

        Conversion options including the geographic origin

      Returns BufferGeometry

      A Three.js BufferGeometry representing the polyhedral surface

      The function expects WKT in the format:

      POLYHEDRALSURFACE Z (
      ((lng1 lat1 alt1, lng2 lat2 alt2, lng3 lat3 alt3, lng1 lat1 alt1)),
      ...
      )

      Error if WKT is not in POLYHEDRALSURFACE Z format

      Error if WKT contains no valid triangular faces

      Error if coordinate parsing fails

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

      const wkt = 'POLYHEDRALSURFACE Z (((-0.1 51.5 0, -0.1 51.6 0, -0.2 51.5 0, -0.1 51.5 0)))';
      const origin = { latitude: 51.5074, longitude: -0.1278, altitude: 0 };

      const geometry = wktToBufferGeometry(wkt, { origin });
      // Use in a mesh:
      // <mesh geometry={geometry}>
      // <meshStandardMaterial />
      // </mesh>

      bufferGeometryToWKT for the inverse operation