Quantcast
Viewing all articles
Browse latest Browse all 2341

New Post: How to determine endpoints of multi-part polyline

Hi Don, if I understood it correctly, the problem is specific to your data. There is hardly any ready to use solution, as parts of multipart polyline aren't necessarily adjacent. Therefore there is no such thing as specific 2 ends of multipart polyline from the MW's point of view.
But your approach with Adjacent function should work. Just:
  • take the end point of particular segment;
  • build rectangle around it (which represent the tolerance; something like Rectangle(x - tol, y - tol, x+ tol, y + tol));
  • loop through the endpoints of all other parts (both get_Part and get_EndPart) and count the number of those which are within the rectangle;
  • if there is one neighbor - it's in the middle, if there is none - it's the end point;
    The trick is to correctly set the tolerance. Then, given that the parts are indeed adjacent, it should work.

Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>