I ran into some issues using gridintersect for a structured grid and a large polyline dataset.
- the
transform function is seemingly called on X,Y of the first and second point of each vertex instead of two arrays of X and Y coordinates. This seems incorrect. see:
|
rx, ry = transform( |
|
[pt[0]], |
|
[pt[1]], |
|
self.mfgrid.xoffset, |
|
self.mfgrid.yoffset, |
|
self.mfgrid.angrot_radians, |
|
inverse=False, |
|
) |
- when processing multilinestring, the
rotate function is called on a list of geometries instead of a geometry. This seems to fail. The function should iterate over each geometry in the list and perform rotation and translation. See:
|
ix_realworld = rotate( |
|
ix, self.mfgrid.angrot, origin=(0.0, 0.0) |
|
) |
- the
_check_adjacent_cells_intersecting_line method fails when intersection produces a GeometryCollection instead of a MultiLineString. GeometryCollection is a composite geometry with the geoms attribute, and should be processed similar to a MultiLineString. More generally this function should check for the presence of the geoms attribute.
|
if intersect.geom_type == "MultiLineString": |
|
x, y = [], [] |
|
for igeom in intersect.geoms: |
|
x.append(igeom.xy[0]) |
|
y.append(igeom.xy[1]) |
|
x = np.concatenate(x) |
|
y = np.concatenate(y) |
Can do a PR with quick fixes if desirable.
I ran into some issues using gridintersect for a structured grid and a large polyline dataset.
transformfunction is seemingly called on X,Y of the first and second point of each vertex instead of two arrays of X and Y coordinates. This seems incorrect. see:flopy/flopy/utils/gridintersect.py
Lines 725 to 732 in 0e380bc
rotatefunction is called on a list of geometries instead of a geometry. This seems to fail. The function should iterate over each geometry in the list and perform rotation and translation. See:flopy/flopy/utils/gridintersect.py
Lines 734 to 736 in 0e380bc
_check_adjacent_cells_intersecting_linemethod fails when intersection produces a GeometryCollection instead of a MultiLineString. GeometryCollection is a composite geometry with thegeomsattribute, and should be processed similar to a MultiLineString. More generally this function should check for the presence of thegeomsattribute.flopy/flopy/utils/gridintersect.py
Lines 975 to 981 in 0e380bc
Can do a PR with quick fixes if desirable.