Select to view content in your preferred language

Unexpected behavior from Points to Line tool in Desktop 10.5.1

1093
8
06-12-2018 12:42 PM
SarahHugenberger
Emerging Contributor

If you are familiar with the Points to Line tool, do you have any ideas about why I'm getting the following behavior. 

I have a shapefile of points:

From the Points to Line help (Points To Line—Data Management toolbox | ArcGIS Desktopthis is a graphical representation of what the tool does:

What I'm hoping for is roughly the same thing, i.e. the line my 5 year old would draw if I asked him to connect the green points. But instead, I'm getting this:

I'm leaving Line_Field blank, Sort_Field blank, and have tried both checking and unchecking Close_Line

I know I want to leave Line_Field blank because I want all points treated the same way. I'm also leaning towards leaving Close_Line unchecked because I would eventually like to use the (correct) output line to connect with another line to make a polygon, so I don't want the end vertex to be the same as the start vertex. But I'm open to ideas about the Sort_Field. The description of the default behavior is that "points used to create each output line feature will be used in the order they are found." 

Any ideas?

0 Kudos
8 Replies
DanPatterson_Retired
MVP Emeritus

on first glance, it appears that your points are not sequentially ordered by their appearance in the table, but the order depends on some other field... do you have a field in the table that can provide the ordering?

SarahHugenberger
Emerging Contributor

It appears to be using FID to sort. I had hoped that "in the order they are found" meant that it would use some kind of nearest neighbor algorithm and not just pick a field to use. If I had wanted them ordered by FID I would have put that into Sort_Field. And I have no other fields that would get me what I want.

Do you happen to know how to get it to work more like a nearest neighbor algorithm?

0 Kudos
DanPatterson_Retired
MVP Emeritus

A Peano sort How Sort (management) works—Data Management toolbox | ArcGIS Desktop if you have the license.

If it is a shapefile, can you zip it (all I need is FID and shape fields) and attach it to your post.

I would just need to know one of the two points nearest the short.  I will see if I can implement a sequential distance sort from an origin using numpy

SarahHugenberger
Emerging Contributor

Thank you for this lead. I do have the correct license and while using the PEANO sort improved the line somewhat, I'm still not getting what I'm hoping for. And it sounds like in order to get the outcome I want, it would involve a skill set (NumPy) beyond what I have. I appreciate your offering to help with that, but since this is a project for school I better stick to what's in my wheelhouse. (Although I'm really curious to see this idea through to its conclusion). 

If you're curious, here is the what the PEANO sort gave me:

I do wonder if I could get better results by somehow specifying a point with which to start, but since my end goal is to script/automate this process that wouldn't work for the long run. Thanks again for your help.

0 Kudos
DanPatterson_Retired
MVP Emeritus

haven't played with it in a while, but a

Minimum Spanning Tree might piece it together...

you would have to convert to a single polyline if it connects properly.

When class is over, post the points ... it is too bad that there are no other attributes that would facilitate ordering

SarahHugenberger
Emerging Contributor

I tried this out, but I kept getting the error:

The toolbox:  c:/program files (x86)/arcgis/desktop10.5/ArcToolbox/Toolboxes/Data Management Tools.tbx

  could not be loaded.  Check your toolbox path

This is the path to my toolboxes, except with back slashes instead of forward slashes. I'll admit I've never been great with understanding exactly why and when the direction of the slashes differs, but I'm guessing you have a reason to be looking for the toolbox with this syntax.

 

0 Kudos
DanPatterson_Retired
MVP Emeritus

If you have PRO installed you can try its version

Point Tools... for Pro 

0 Kudos
DanPatterson_Retired
MVP Emeritus

Sarah

ran a quick test with Spanning Tree on a set of un-sequenced points

It will probably work ok as long as the inter-point spacing is less than the inter-imaginary-line spacing

0 Kudos