Select to view content in your preferred language

Calculating fields - add start and end coordinates of line features to table

5810
10
Jump to solution
04-16-2013 01:41 AM
AlexanderPichlmayr
Emerging Contributor
Hello everybody,

Since a wile I am serching a way to solve a problem but cant get to any result.
What I want to do is to add koordinates of the startpoint and endpoint of a line-feature to its attribute table.
In my project I have to traw a great number of lines (representing power grid) so I manually added 4 fields (StartX, StartY, EndX, EndY). Is there any toold in arc toolbox that can help me calculate the koordinates for those 4 fields. Manually adding the data would be very time consuming. For better understanding i attached a photo with a sample of the grid (green line) and its attribute table.


Thanks for any kind of help
Alex
0 Kudos
10 Replies
RichardFairhurst
MVP Alum
Oh well as would be the case I spoke too soon.  Initially, it did finish but when I actually reviewed the results It had only calculated the coordinates for the first 1970 records (Start_X, Start_Y, End_X, End_Y) ???? 
So to check that result I tried to redo it but this time ArcMap CRASHED!!!  It asked if I wanted to send an error report to ESRI and I said yes, why not?

Then comes the funny bit....

...then would you believe it that Crashed also!!!
[ATTACH=CONFIG]24354[/ATTACH]

So really it is back to my original question ... how do I do this?????


You have a corrupted point.  Probably it has no coordinate and is an empty shape.  That will fail. 

Select everything that did not calculate, sort it on the objectID.  First try panning to the first record.  If it does not move the location, you have a corrupted point.  These points get created when you do not actually set the geometry of a point, but instead start entering attributes before the point ever got set (which will insert a record with empty geometry).  The same can happen with lines and polygons that have only attributes, but no geometry.  But lines and polygons are easier to find, because they always have lengths or perimeters of 0 length (points show no automatically created measurements to tell you that they are corrupt).

If that is the case, deselect that first point.  Now try the calculation on the rest of that selection set.  If that works, you have confirmed that you have a corrupted point.  In any case there is no need to recalculate the points you already got coordinates assigned to for the X coordinate.

Check geometry might also detect any corrupted points if it fails a second time.
0 Kudos