FloPy Voronoi Grid Module Error

132 views
Skip to first unread message

emma white

unread,
Aug 9, 2021, 11:52:53 PM8/9/21
to MODFLOW Users Group
Hi everyone,

I would like to import a Voronoi grid created in AlgoMesh into FloPy. 
I have loaded the NAM and DISU files for a USG model that were both generated by AlgoMesh into FloPy and I am trying to use the FloPy Voronoi Grid module to create a grid object from an input of cell centers.  

However, when I run the line to call the module:
    vg = flopy.utils.voronoi.VoronoiGrid(cell_centers)
 
I get the following error 
  
  File "shapely/speedups/_speedups.pyx", line 321, in  shapely.speedups._speedups.geos_linearring_from_py

  ValueError: A LinearRing must have at least 3 coordinate tuples

Has anyone come across this error before?  I am using version '2.1.3' of shapefile a
flopy version: 3.3.4
geopandas version: 0.6.3
python version 3.7 

Any advice on loading AlgoMesh grids into FloPy would be great.

Thanks
Emma



Message has been deleted

Rui Hugman

unread,
Aug 11, 2021, 12:59:48 AM8/11/21
to MODFLOW Users Group
Hi Emma,

I don't quite recall (it has been a while), but I don't think I ever managed to get Flopy to accept a Algomesh generated DISU grid directly. .

This fix sometimes helps with shapely speedup errors. Not sure if it will resolve your issue:

In the past I've used this script to obtain input for a DISV grid from an Algomesh DISU grid. It should be simple enough to adapt for your case:
https://github.com/rhugman/disu_2_disv

Hope that helps,
Rui

Reply all
Reply to author
Forward
0 new messages