HOW TO

Define projection for all files in a workspace

Last Published: July 12, 2021

Summary

The instructions provided describe how to define the projection for all files in a workspace.

Procedure

In ArcMap, use model iteration to define the projection for all files in a workspace. The Define Projection tool is used when the files have no assigned projection.

Note:
In ArcMap, click Geoprocessing > Geoprocessing Options. In the Geoprocessing Options window, ensure the When connecting elements, display valid parameters when more than one is available check box is checked, as shown in the image below. The ModelBuilder Connect tool displays the option to select the target parameters.
The Geoprocessing window displays the When connecting elements, display valid parameters when more than one is available check box.
  1. Create a new model.
    1. In the Catalog pane, right-click the folder where the MXD is located, and click New > Toolbox.
    2. Rename the toolbox as desired.
    3. Right-click the toolbox, and click New > Model. This creates a model in the toolbox and opens ModelBuilder for editing the model.
    4. In the Catalog pane, under the newly created toolbox, right-click the model, and select Rename to rename it according to its intended task.
Note:
To view the model properties, right-click the model in the Catalog pane, and click Properties. In the Model Properties window, click the General tab. The General tab displays the options to configure the model's name, label, and description.
  1. Add an iterator to the model.
    1. If the new model is not already open, right-click the model in the Catalog pane, and select Edit to open the model's window.
    2. In the model's window, click Insert > Iterators > Feature Classes. The iterator is white since no parameter values have been provided.
    3. Double-click the Iterate Feature Classes hexagon. In the Iterate Feature Classes window, for Workspace or Feature Dataset, specify a folder, geodatabase, or feature dataset as the workspace.
    4. Click OK after valid inputs are specified in the Iterate Feature Classes window. A dark blue input is displayed.
Note:
The Wildcard (optional) and Feature Type (optional) parameters are used to restrict the feature classes selected for the iteration. This iterator has two output variables, the output feature class file, and the name of the output feature class. The output FeatureClass file can be connected to the next tool in the model for processing, and the Name variable can be used for inline variable substitution.
The model's window displays the Iterate Feature Classes window and parameters.
Note:
ModelBuilder uses color to indicate the status of tools and variables. A white color indicates input parameters are not specified. Once the parameteres are specified, the iterator color changes to orange (other tools change to gold). Inputs are displayed in blue and outputs in green. 

The iterator before and after parameter values are provided.

The comparison of the model window before and after all parameters of the model components are specified.
  1. Add the Define Projection tool to the model. In ArcMap, click ArcToolbox. The ArcToolbox pane opens.
    1. Navigate to ArcToolbox > Data Management Tools > Projections and Transformations.
    2. Drag and drop the Define Projection tool into the ModelBuilder canvas in an empty area.
  2. In the model, use the Connect tool on the toolbar to connect the iterator’s output feature class variable to the Define Projection tool, and select Input Dataset or Feature Class.
The model window siplaying the Define Projection tool in the model, and the Input Dataset of Feature Class option for the Define Projection tool.
  1. In the model, double-click the Define Projection tool. The Define Projection window opens.
    1. For Input Dataset or Feature Class, specify a dataset or feature class with the projection to be defined. If there are feature classes in the previously selected workspace, this field is populated automatically with one of the feature classes. If the workspace is empty, this field displays a generic output name.
    2. For Coordinate System, select the coordinate system to be applied to the input.
Note:
The Define Projection tool is used to define the projection of a feature class that does not have any specified coordinate system. When the tool is run from the model, it does not create a new feature class as output, it only sets the projection for the original feature class. If the tool is used on a feature class that already has a projection defined, the following error message is returned, "000132: The dataset already has a projection defined."
  1. Configure the following model parameters.
    1. Right-click the dark blue input to the iterator, and check the Model Parameter option. This displays the parameter when the model is run from its toolbox.
    2. Right-click the Define Projection tool, and select Make Variable > From Parameter > Coordinate System.
    3. Right-click the Coordinate System oval, and check the Model Parameter option.
The model window displaying colored components of the model ready to be validated and run.
  1. Validate the model to check for any errors. Navigate to the Model drop-down menu, and click Validate Entire Model.
The model drop-down menu displaying the Validate Entire Model option.
Note:
A process in the model is ready to run only when all required parameters are provided for the iterator and the tool. In the model window, ensure all boxes and ovals are colored before running the model.
  1. Save the model, and navigate to Model > Model Properties > Parameters. View the parameter properties and change the names and order of parameters as desired.
The DefineProjection Properties window displaying the Parameters tab and its properties.
Note:
The Iterate Feature Classes tool iterates the feature classes in a workspace. The output of the iterator is the input of the Define Projection tool. The Define Projection tool modifies the input feature class rather than creating a new output feature class. When the model is run, the projection of the feature classes in the workspace is set by the tool.
  1. Run the model from its toolbox in ArcCatalog or the Catalog pane in ArcMap.

Article ID:000012116

Software:
  • ArcMap

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic