This package translates geospatial vector data (points, lines, or polygons) to unstructured meshes. The package converts geospatial data, presented as geopandas GeoDataFrames, to unstructured meshes using the open source high quality mesh generators:
utilizing the respective Python API's, available at:
For completeness, the source code of both projects can be found at:
- https://gitlab.onelab.info/gmsh/gmsh, under
api/gmsh.py
- https://github.com/drufat/triangle
These APIs are wrapped in two lightweight classes: pandamesh.TriangleMesher
and pandamesh.GmshMesher
. Both are initialized with a GeoDataFrame defining
the geometry features of the mesh. During initialization, geometries are
checked for overlaps and intersections, as the mesh generators cannot deal with
these. Generated meshes are returned as two numpy arrays: the coordinates of
the vertices, and the connectivity of the mesh faces to these vertices (as is
usual for many unstructured grid representations).
GeoPandas is not suited for geometries that "wrap around" around the world. Consequently, this package cannot generate meshes for e.g. a sphere.
pip install pandamesh