Improve the snap algorithm choosing the closest_point as snapped vertex
|Reported by:||aperi2007||Owned by:||strk|
Actually the snap algorithm choose as snap point the first vertex that match the rules (under to snap value) calling it "first snappable point". This could cause invalid polygon when there is more than one vertex under the limit snap value. To avoid this kind of invalidity an improve to the algorithm could be to snap the closest_point instead of the first snappable point.
Find the closest_point if a time consuming analyze because should be necessary to analyze all the vertex of the geometry. But realistic many cases are resolvable checking a more limited number of vertex after the the analyzing vertex as example checking 10 or 20 vertex after the first snappable point to see if exists a more closest point.