Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dfmt.polyline_mapslice with uds.intersect_line #682

Open
veenstrajelmer opened this issue Nov 24, 2023 · 0 comments
Open

Replace dfmt.polyline_mapslice with uds.intersect_line #682

veenstrajelmer opened this issue Nov 24, 2023 · 0 comments

Comments

@veenstrajelmer
Copy link
Collaborator

veenstrajelmer commented Nov 24, 2023

replace dfmt.polyline_mapslice() with new uds.intersect_line and uds.intersect_linestring implemented in Deltares/xugrid#155

In get_xzcoords_onintersection the variable uds_sel can be derived with:

from shapely import LineString
uds_sel = uds.ugrid.intersect_linestring(LineString(line_array))
uds_sel = uds_sel.rename_dims(nmesh2d_face='ncrossed_faces')

This contains also mesh2d_s (distance from start of line). However this is in degrees in case of geographic data. Also, it does not contain the coordinates of the intersections between edges and linestring (they are reduced here), but only the centers instead. It does seem to contain sorting, which is good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant