Skip to main content

From geodataframe to mesh

Project description

pandamesh

.. image:: https://img.shields.io/github/workflow/status/deltares/pandamesh/ci?style=flat-square :target: https://github.com/deltares/pandamesh/actions?query=workflows%3Aci .. image:: https://img.shields.io/codecov/c/github/deltares/pandamesh.svg?style=flat-square :target: https://app.codecov.io/gh/deltares/pandamesh .. image:: https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square :target: https://github.com/psf/black

This package translates geospatial vector data, presented as geopandas_ GeoDataFrames_, to unstructured meshes using the open source high quality mesh generators:

  • Christophe Geuzaine and Jean-François Remacle's Gmsh_
  • Jonathan Shewchuk's Triangle_

utilizing the respective Python API's, available at:

For completeness, the source code of both projects can be found at:

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.

Installation

.. code:: console

pip install pandamesh

Documentation

.. image:: https://img.shields.io/github/workflow/status/deltares/pandamesh/docs?style=flat-square :target: https://deltares.github.io/pandamesh/

.. _geopandas: https://geopandas.org/ .. _GeoDataFrames: https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.html .. _Gmsh: https://gmsh.info/ .. _Triangle: https://www.cs.cmu.edu/~quake/triangle.html .. _usual: https://ugrid-conventions.github.io/ugrid-conventions/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandamesh-0.1.0.tar.gz (22.2 kB view hashes)

Uploaded Source

Built Distribution

pandamesh-0.1.0-py3-none-any.whl (25.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page