Adding XY fields to .shp file

332
7
06-13-2012 09:38 AM
MikeWhite1
New Contributor
Hello,

I have a .shp file that I need to export to another external program. The .shp file does not have X or Y fields. Can someone please explain how I would be able to generate such Fields from the .shp file
0 Kudos
7 Replies
MathieuCain
New Contributor III
Hello,

I have a .shp file that I need to export to another external program. The .shp file does not have X or Y fields. Can someone please explain how I would be able to generate such Fields from the .shp file


Data Management Tools > Features > Add XY Coordinates
0 Kudos
MikeWhite1
New Contributor
Tried that option. It comes up with an error "000366: Invalid Geometry Type".

On a side Note, the Polygon I am trying to find XY data for is a polygon of Greenland. I created the shapefile of Greenland from an existing map and the atrribute fields I have are as follows:

FID    Shape    ScaleRank      Featureclass      Note
0 Kudos
MathieuCain
New Contributor III
Tried that option. It comes up with an error "000366: Invalid Geometry Type".

On a side Note, the Polygon I am trying to find XY data for is a polygon of Greenland. I created the shapefile of Greenland from an existing map and the atrribute fields I have are as follows:

FID    Shape    ScaleRank      Featureclass      Note


What do you want your coordinates to represent? The "Add XY Coordinates" tool works on Point features. Do you want coordinates for each of the nodes making up your polygon or do you want the coordinates for say the centre point of your polygon?
0 Kudos
MikeWhite1
New Contributor
I need the XY coordinates for each of the nodes making up the polygon
0 Kudos
michaelcollins1
Occasional Contributor III
You'd need to convert the polygons to points first (try ET Geowizards for that), then use the Add XY Coordinates tool on the new point shape file
0 Kudos
MathieuCain
New Contributor III
I need the XY coordinates for each of the nodes making up the polygon


To calculate the coordinates of the centroid of each polygon, you would have simply created two empty X and Y double fields in your feature class' attribute table and then right clicked on each field and calculated it's geometry using "X Coordinate of Centroid"/"Y Coordinate of Centroid".

However, in your case you will need to first convert your polygon layer to points and then run aforementioned tool. For ease of use, I would likely use ET GeoWizards' Polygon to Point tool.
0 Kudos
MarcinGasior
Regular Contributor
To get all polygon vertices you can also use Feature Vertices To Points tool.
And then use Add XY Coordinates tool as it was said.

If you want to directly export vertex coordinates to text file, try the script presented in this thread (it exports coordinates and reports inner rings).
0 Kudos