Workflow automation
Building custom model and script tools allows you to not only automate common workflows but also to document them. Presented below are the model pieces and a final composite model for the aggregation component of the Celebrating Linguistic Diversity case study. The final model presented, and also provided in the data package above, splits and aggregates neighborhoods with suppressed data, combining them with neighborhoods that do have data. The steps are summarized graphically below using only five neighborhoods for simplicity.
If you need to perform this type of aggregation regularly, the workflow outlined below should get you started with building your own custom Geoprocessing model tool. The focus of this workflow is to create a model tool designed to work specifically with the case study data. Documentation is also provided, however, to help you build and share more generic tools that would be robust to a variety of different data sources.
Access the model tool and data
- If you haven't done so already, download and unzip the data package provided at the top of this workflow.
- To work with ModelBuilder in ArcGIS Pro, open ArcGIS Pro and browse to the LingualDiversity.ppkx project package. When it opens, expand the Folders on the Project pane until you find the LinguisticDiversity.tbx toolbox. Expand the toolbox, right click on the Aggregate Neighborhoods model tool, and select Edit.
- To work with ModelBuilder in ArcMap, double-click the LanguageData.mpk map package and use the Catalog to browse to the AnalysisModels.tbx toolbox. Expand the toolbox, right click on the Aggregate Neighborhoods model tool, and select Edit.
Create working layers
The AllNeighborhoods data set contains a field (HasDataMT) indicating whether the mother tongue data has been suppressed or not for each neighborhood. The model selects the neighborhoods where HasDataMT is equal to one, and passes the selected features to the Copy Features tool. The result is a new data set (DataNeighborhoods), containing 328 neighborhoods with mother tongue data. The model then selects the neighborhoods where HasDataMT is equal to zero and, again, passes those selected features to the Copy Features tool. The result is a new data set (NoDataNeighborhoods), containing the 60 neighborhoods with suppressed data. Finally, the model uses the Select Layer By Attribute tool to clear all selections.
The dashed arrows in the model above reflect preconditions. If you right click the final Select Layer By Attribute element in the model, you can ensure selections are not cleared until both the DataNeighborhoods and NoDataNeighborhoods layers are created.
Create random points
Add the CID field to DataNeighborhoods
This step creates a new field called CID inside DataNeighborhoods and calculates the values to be the ObjectID. This step ensures every working layer has the CID field; this will be important for the last step in the model.
Create, snap, and dissolve Thiessen polygons
Aggregate the NoDataNeighborhood pieces with the DataNeighborhoods
You can find the final model in both the ArcGIS Pro project package and the AnalysisModels toolbox included in the data package.