[GIS] How to assign node IDs to links in a network

arcgis-10.0arcgis-desktoplineNetwork

I have two shapefile layers in ArcGIS for Desktop 10.

I have one line layer and node layer.

My node layer(shp) has a "code_1" field and line layer has a "code_node" field.

The intersection point of the line layer has only one node.

I want get the code from the "code_1" field of the node layer for the line's "code_node" field

For example, for one line, the first node has code_1=1 and the node at the end of line has code_1=2. In this case the code_node attribute in that line must be "12",.

How can I automatically get the code from the nodes for each line?

enter image description here

Best Answer

Use Feature Vertices To Points to get the START points from the line shapefile. Do the same for END points. Name the resulted layers "start" and "end". Then use Spatial Join to join these resulted layers to your node layer separately (Target features: "start" and "end" layers, Join feature: your node layer, JOIN_ONE_TO_ONE, Match Option: Intersect). Name the resulting layers "startJoin" and "endJoin". Add a new field "origin" to your line layer (with the same properties as your "code_1" field, I suggest TEXT format). Join your line layer to "startJoin" (match FID to ORIG_FID) and by field calculator copy "code_1" in the "origin" field. Add another field "destination" to your line layer and do the same (you may want to remove the existing join before doing this) for "endJoin" and get the "code_1" into "destination" field. Fianlly, do this field calculation to your "code_node" field: [origin]&[destination]

Related Question