Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = np.linspace(xx[0,0],xx[623,1287],num=1288)
- y = np.linspace(yy[0,0],yy[623,1287],num=624)
- hlines = [((x1, yi), (x2, yi)) for x1, x2 in zip(x[:-1], x[1:]) for yi in y]
- vlines = [((xi, y1), (xi, y2)) for y1, y2 in zip(y[:-1], y[1:]) for xi in x]
- grid = list(polygonize(MultiLineString(hlines + vlines)))
- poly_grid = gpd.GeoDataFrame({'geometry':grid})
- test = gpd.sjoin(pipelines, poly_grid, op='intersects')
- test.head()
- geometry index_right
- 0 LINESTRING (-117.149389922 33.41909344100003, ... 264022
- 0 LINESTRING (-117.149389922 33.41909344100003, ... 264021
- 0 LINESTRING (-117.149389922 33.41909344100003, ... 264020
- 0 LINESTRING (-117.149389922 33.41909344100003, ... 264019
- 0 LINESTRING (-117.149389922 33.41909344100003, ... 263395
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement