Wednesday 17 February 2016

arcgis desktop - Iterating in ModelBuilder?


Ultimate goal is to pull data from a Feature Class, group out the different types of Lease Status (field), run a dissolve and sum calculation on each new layer/FC then merge all new layers/FC's together into one FC.


This is my manual process for what I am trying to accomplish: I went about creating a table that includes one Tract_ID, the lease_status and a sum calculated on the Percent_interest field for all the owners. (probably very rudimentary LOL)


(create initial tables to work from)





  • Export DBLeaseOR8312m into a new layer/FC for each lease_status for example DBLeaseOR8312m_open, DBLeaseOR8312m_ThirdParty, etc.




  • From the DBLeaseOR8312m_open FC select all other lease_statuses and delete




  • Run dissolve on the new layer



    • Select Tract_ID as the dissolve field


    • Select percent_interest and “SUM” in the statistics area




(modify new tables to include new field)



  • This creates a new table that only has one Tract_ID, one type of Lease_status and the percent_interest calculated for all owners and included in percent interest field.

  • Creat new field in this table for Lease_status and add the specific type to that field

  • Do this for each Lease_status type



(merge data together into one final table)



  • Then merge all tables into one table to include all lease_status types.


I'm thinking I can use Iterate Feature Selection in model builder but not quite sure how to bring it all together and set my outputs...



Answer



I like to run such things from a file geodatabase to keep all the fields consistent for field mapping in your model.


If I interpreted correctly you want to: 1. split your FC by lease type. 2. Dissolve each resulting FC on the lease type and sum the percent interest for that lease type. 3. and then combined all FC's back together.


From what I have gathered, starting with multiple iterations of the "Select" tool will work to split your feature class by Lease type. You will need to make sure you have a selection for each possible Lease type in your model, and that the attribute values are consistent. Then add the dissolve tool to each of the outputs from the select. When you open the properties of the dissolve tool you should see the list of fields from the select output. Check the fields you want to dissolve on. The others will be dropped from your attribute table. (Don't check your interest field since you want to sum that value). Instead at the bottom of the dissolve tool properties window you will see the statistics field option. Add the interest field there and choose the "SUM" option. Then use the "Merge" tool to combined all the outputs from the dissolve tool back together.


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...