Monday, 16 April 2018

arcgis 10.0 - Updating 30 Shapefiles, adding attribute and populating based on data


I need to add an attribute to each shapefile attribute table in ArcMap, I was thinking to do it in SQL, but I'm not sure how to go about doing it since I'm very new to ArcMap.


Can someone explain to me how I would go about doing this?


The added attribute would need each value populated based on another attribute in the table.


Thanks.



Answer



If you do not have experience in scripting I would suggest using ModelBuilder for this task.




  1. Open ModelBuilder via ArcCatalog or ArcMap

  2. Drag in any shapefile or feature class

  3. Add in the Calculate Field tool (assuming that each feature class has the same field names to run against the calculation)

  4. Add a Pre Logic Script Code in the expression button

  5. Make the first input layer a Model Parameter

  6. Run the model and browse for a feature class to update

  7. Run model again and browse for next feature class to update


If you are more fluent in scripting I would suggest writing a python script using the same method above, however you can define a common workspace where all the feature class exist that you want to update. You can use os.walk to iterate through each feature class in the directory and perform the field calculation in batch.



Hope that helps


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...