Open Huite opened 11 months ago
From the vector conversion examples:
lines = gpd.GeoDataFrame(geometry=provinces.exterior)
length = xu.length_of_intersection(lines, uda)
fig, ax = plt.subplots()
length.ugrid.plot(ax=ax)
length.ugrid.plot.line(ax=ax, edgecolor="black", linewidth=0.5)
provinces.plot(ax=ax, edgecolor="red", facecolor="none", linewidth=1.5)
ax.set_xlim(xmin, xmax)
ax.set_ylim(ymin, ymax)
For example, to compute conductances in a MODFLOW model, it's very useful to get the total length of a river within a cell:
However, this function has a lot of overlap with _burn_lines, ideally we can do the least amount of duplication. We could also add the length of the intersection as a coordinate, but it's likely a bad idea (it will contain a lot of NaNs).