I have more than 1000 shape files (all are point features). They were initially in WGS 84. I projected them in UTM. Then through batch processing I added X, Y fields in each table. But all the X, Y fields are now empty or rather filled with 0. I need to calculate X, Y projected coordinate through batch processing and fill newly added X, Y fields. I checked in calculate field option for batch processing under data management tool. But don't see any calculate geometry option there. Where can I find the tool in the tool box so that I can use it for batch processing all my tables to calculate X, Y in meters. I am using ArcGIS


You can accomplish this in batch mode, in ModelBuilder and with Python.

Batch Mode:

  1. First delete your old XY fields using Delete Fields in batch mode. Right click on the tool and select "batch". Drag the files you want to process into the dialog box. The rows will automatically update to include all of the files you are processing.
  2. Choose the XY fields you want to delete > Fill
  3. Now add new XY fields. Search for the Add XY Coordinates (Data Management) tool in the Search tab. Right click the tool > Batch... (screenshot)
  4. Select the files you need to calculate in the Catalog and drag them over to the batch dialog box.
  5. Run the tool in batch mode. Note that the tool will automatically add an X and a Y field and calculate the coordinates.

enter image description here

Note that the can drag and drop multiple files from the highlighted section in Catalog, but only single files from the top window

enter image description here


Same workflow as in batch mode, although it is much easier to string together commands in ModelBuilder.

enter image description here


Again, the same workflow as above.

import arcpy

# The workspace where all your files are located
arcpy.env.workspace = r'C:\temp'

# Loop through the list of all your files
for fc in arcpy.ListFeatureClasses():
    arcpy.DeleteField_management (fc, ['x','y']) # Delete the old fields
    arcpy.AddXY_management (fc) # Add XY fields again and calculate coords
|improve this answer|||||
  • Thank you for your answer. Although I am using batch mode, but I cannot select all the files in one go. I have to select the files one by one for each row. How can I select all the files together? – user26161 Aug 20 '14 at 8:36
  • When you browse for a file from the batch window, you can select multiple files. It will then add a new row per file. Alternatively, select all the files in windows explorer or ArcCatalog and you can drag and drop them into the batch window. This will populate it with a row per shapefile. But it will be easier to run this as a python script or an iterating model like Aaron has shown you above. – Dan_h_b Aug 20 '14 at 12:36
  • @user26161 As Dan pointed out, you can drag and drop multiple files from catalog. I updated the post to include more information on how to do that. – Aaron Aug 20 '14 at 16:15
  • @user26161 It's no problem. There should be a check mark you can click up by where you can vote the answer up or down. If you're on mobile, it might be different. – ianbroad Aug 21 '14 at 5:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.