'Detecting' vertice/point connections with python

332
4
Jump to solution
06-30-2014 01:36 AM
ChristopherEarley
New Contributor II
Hi,

Does anyone know how to programmatically detect what features a vertice/point is connected to in ArcGIS? My reason for asking this is I am developing a watercourse network and would like to identify node inputs/outputs. I am aware that a spatial join can acheive this somewhat, but would prefer to use something a little less involved if thats possible.

Regards,

Chris
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
ChrisSnyder
Regular Contributor III
Each arc has a "first point" and "lastpoint" (aka FromNode and ToNode), which are properties easily retrievable by a search cursor or field calculator. Then the derived x,y coordinate pairs of the first and last points can then be used as unique identifiers to model flow/connectivity. Of course the StreamToFeature tool automatically populates topologically correct TO_NODE and FROM_NODE field values, so that's even more convenient.

View solution in original post

0 Kudos
4 Replies
markdenil
Regular Contributor II
one word: topology
0 Kudos
ChrisSnyder
Regular Contributor III
Each arc has a "first point" and "lastpoint" (aka FromNode and ToNode), which are properties easily retrievable by a search cursor or field calculator. Then the derived x,y coordinate pairs of the first and last points can then be used as unique identifiers to model flow/connectivity. Of course the StreamToFeature tool automatically populates topologically correct TO_NODE and FROM_NODE field values, so that's even more convenient.

View solution in original post

0 Kudos
ChristopherEarley
New Contributor II
Thanks for your advice Mark/Chris,

Apart from the Resource Centre literature on topology, do you know of any other online/offline literature relating to the manipulation of the first/last point? Particularly something that utilizes python?

Thanks,

Chris
0 Kudos
ChrisSnyder
Regular Contributor III
I don't know of any literature. My approach has been to load the node data into Python dictionaries and then write code that traverse those dictionaries.

Basically one dictionary is keyed by toNode values (either the TO_NODE value from the attribute table or end point x,y coordinate pairs)and each key then stores the OID(s) and fromNode(s). The other is keyed by fromNode and each key then stores the OID(s) and toNode(s). The technique then is to alternate through the keys in the dictionaries, getting a node, and then looking up the node that are attached (keeping track of the OIDs along the way), rinse and repeat.
0 Kudos