Skip to content

Commit

Permalink
Fix(ModflowSfr2.export): Update ModflowSfr2.export() to use Grid inst…
Browse files Browse the repository at this point in the history
…ead of SpatialReference (#820)

* Update(plot_bc): updated plot_bc for MAW, UZF, SFR, and multiple bc packages

* fixed bug with mf2k loading #802
* added shapefile support for output_helper #807
* updated test cases

* Fix(ModflowSfr2.export): Update ModflowSfr2.export() to use modelgrid instead of SpatialReference
  • Loading branch information
jlarsen-usgs committed Feb 29, 2020
1 parent 65e8ada commit b6c9a3a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions flopy/modflow/mfsfr2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1831,9 +1831,11 @@ def export(self, f, **kwargs):
if isinstance(f, str) and f.lower().endswith(".shp"):
from flopy.utils.geometry import Polygon
from flopy.export.shapefile_utils import recarray2shp
verts = self.parent.sr.get_vertices(self.reach_data.i,
self.reach_data.j)
geoms = [Polygon(v) for v in verts]
geoms = []
for ix, i in enumerate(self.reach_data.i):
verts = self.parent.modelgrid.get_cell_vertices(
i, self.reach_data.j[ix])
geoms.append(Polygon(verts))
recarray2shp(self.reach_data, geoms, shpname=f, **kwargs)
else:
from flopy import export
Expand Down

0 comments on commit b6c9a3a

Please sign in to comment.