Skip to content

Conversation

@tkoyama010
Copy link
Member

Summary

  • Add GeoMesher class for generating meshes from geospatial vector data (geopandas GeoDataFrames)
  • Support polygons with holes and customizable cell sizes
  • Provide pandamesh-style API returning vertices and faces as NumPy arrays

Motivation

This PR adds functionality similar to pandamesh, allowing users to generate meshes from geospatial data. This is useful for:

  • Geographic/geospatial applications
  • Environmental modeling
  • Any application working with real-world polygon data

Implementation

The new GeoMesher class:

  • Accepts geopandas GeoDataFrames containing polygon geometries
  • Supports polygons with holes
  • Allows per-feature cell size control
  • Returns meshes as NumPy arrays (vertices, faces) following pandamesh conventions
  • Also provides PyVista mesh output for visualization

Examples

Two examples are included:

  1. geospatial_simple.py - Simple example mimicking pandamesh README
  2. geospatial_mesh.py - Comprehensive example with visualization

Dependencies

This feature requires optional dependencies:

  • geopandas
  • shapely (already a dependency)

The feature gracefully handles missing geopandas with appropriate warnings.

Test plan

  • Manual testing with example scripts
  • Add unit tests for GeoMesher class
  • Add documentation to user guide
  • Test with real-world geospatial data

🤖 Generated with Claude Code

Add GeoMesher class for generating meshes from geospatial vector data,
similar to pandamesh. This feature allows users to:
- Convert geopandas GeoDataFrames to unstructured meshes
- Support polygons with holes
- Control cell sizes per feature
- Export meshes as NumPy arrays (vertices, faces)

Includes two examples demonstrating the functionality.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant