Create a feature with XY coordinates

1381
1
07-10-2021 02:14 PM
LeighVanPelt
New Contributor

I am create feature layers in Pro but when I open the attribute table, there are no XY coordinates for either the polygon or line features I have created. Is there a way to have the coordinates automatically generate into the attribute table during the feature creation? Here are a few things I have already tried...

  1. Use the Create Feature Class geoprocessing tool, then
  2. Use the Create Feature geoprocessing tool

This does not automatically add the XY coordinates to the attribute table even though I did assign the same coordinate system as the basemap.

-------------------

  1. Use the Feature Vertices to Point geoprocessing tool, then
  2. Add XY coordinates geoprocessing tool, then
  3. Use Table to Excel geoprocessing tool

This can only be done with one layer at a time and would create a lot of extra layers. A problem because there will be lots of layers which would create a lot of different Excel files in which I would have to then put them into a single Excel file. I was wondering if there was a simpler way to get XY coordinates for all layers into a single attribute table.

------------------

I also found a python script but it did not work because all of the feature layers need to be shapefiles. I tried to create shapefiles in the Create Feature Class but it will not accept the .shp extension in the name.

 

 

0 Kudos
1 Reply
DanPatterson
MVP Esteemed Contributor

your won't get all the coordinates for polyline and polygons.

you can get a few types using

Add Geometry Attributes (Data Management)—ArcGIS Pro | Documentation

 

if you want all the coordinates, then you have to use

To get all points you have to use

Feature Vertices To Points (Data Management)—ArcGIS Pro | Documentation

then the add geometry attributes to get their values


... sort of retired...