feat: add BufferGeometry to PostGIS POLYHEDRALSURFACE Z conversion utilities#10
Merged
Conversation
…ilities Add utilities for converting Three.js BufferGeometry to/from PostGIS POLYHEDRALSURFACE Z WKT format, enabling 3D geofence storage in spatial databases. New features: - bufferGeometryToWKT: Convert BufferGeometry to PostGIS WKT format - wktToBufferGeometry: Parse WKT back to BufferGeometry - isCoordsInPolyhedron: Test if geo-coordinates are inside a 3D volume - isPointInPolyhedron: Test if 3D point is inside geometry - bufferGeometryToGeoTriangles: Convert to JSON-serializable format - geoTrianglesToBufferGeometry: Convert GeoTriangles back to geometry - isPointOnSurface: Test if point is on surface within tolerance Includes: - Comprehensive unit tests (39 tests passing) - User-friendly error messages with context - TypeDoc documentation with examples - README documentation section - Interactive Storybook demo with point-in-polyhedron visualization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add utilities for converting Three.js BufferGeometry to/from PostGIS POLYHEDRALSURFACE Z WKT format, enabling 3D geofence storage in spatial databases.
New Functions
bufferGeometryToWKT(geometry, options)wktToBufferGeometry(wkt, options)isCoordsInPolyhedron(coords, geometry, origin)isPointInPolyhedron(point, geometry)bufferGeometryToGeoTriangles(geometry, origin)geoTrianglesToBufferGeometry(triangles, origin)isPointOnSurface(point, geometry, tolerance)Use Case
Users can draw 3D volumes representing geofences in geographic coordinates (lat/lng/altitude), store them in PostGIS with
geometry(POLYHEDRALSURFACEZ, 4326), and query point containment.Includes
@throwsand@exampletagsTest plan
npm run vitest- all 39 tests passnpx tsc --noEmit- no type errors🤖 Generated with Claude Code