Something like this (not tested, and not especially efficient): from shapely.ops import nearest_pointsįor x, y in g1. It shouldn't be too difficult to write one using _points though. Shapely doesn't provide an algorithm for snapping vertices to edges. What you want to do is select one vertex, get your move tool (w), and hold down v while you drag the middle yellow box toward the other vertices. On the right the red vertex is outside the snapping tolerance (despite being closer to the edge!). On the left, the red vertex is within the snapping tolerance to the blue vertex, so it will snap. The function snaps to the vertices of geometries only. If I increase the tolerance I get a wrong output, something like this (after defining 20 as the tolerance of the snapping, the green line is the result):Īny ideas on why the snapping is not working properly?Īny suggestions on how to solve this problem? Although the original lines are pretty close and within the 14 feets Probuilder - snapping not working in vertex/edge selection I moved across to Unity 2020 a while ago and this has been something thats been annoying me a lot. This feature means that EazyDraw's guide and snapping capability is not just a cool trick that works on simple drawing situations, but it is actually a very useful productivity enhancing capability. Only a part is snapped to the black line (the south side). Cloaking means the cloaked graphics do not present their position, vertices, or orientations for position or orientation referencing. In this case the lines are correctly snappedĪnother example where it didn't work as expected: (before the snapping)Īnd here's the result after the snapping. The blue lines are the result of the snapping Res.to_file('result.shp', driver="ESRI Shapefile")Īfter the snapping(with 14 as a tolerance) : Res.geometry = (lambda x: snap(x, lines2_union, 14)) I'm trying to snap two lines to each other using Shapely/Geopandas but the result of the snapping is very odd.
0 Comments
Leave a Reply. |