The spatial reference of a geodataset is made up of the following:
- A coordinate system that consists of a map projection and datum
- XY resolution and, optionally, M and Z resolution and domain
- XY tolerances and, optionally, M and Z tolerances
These spatial reference properties can have significant impact on the performance and results generated by a geoprocessing tool.
- When a geoprocessing tool creates output data, a spatial reference must be assigned to that newly created dataset.
- When a geoprocessing tool processes features from more than one feature class (for example the Intersect tool) or from more than one raster (for example the Weighted Overlay tool), the data must be brought into a common spatial reference to compute relationships between contents of the two datasets.
The spatial reference of the output dataset and the spatial reference in which the processing occurs are one and the same. Another way to state this is that tools always process data in the spatial reference of the output dataset.
What is the default output spatial reference?
Geoprocessing tools determine the output spatial reference using the following logic:
- If the output is inside a feature dataset, the spatial reference properties of the feature dataset are used.
- If the output is a stand-alone geodataset (not inside a feature dataset), the spatial reference properties are the same as the input geodataset's spatial reference properties.
- If the input is a layer in a display, that spatial reference of the layer's data source is used.
- If the input is a list of datasets (for example, the Intersect tool), the spatial reference of the first input dataset will be used.
- If the tool doesn't have an input dataset (for example, Create Feature Class and Create Feature Dataset), it is particularly important to choose a coordinate system so the remainder of the spatial reference properties (such as XY resolution and tolerance) can be calculated by the tool.
How to override the default spatial reference's properties
The geoprocessing environments listed below can be used to override the following default output spatial reference properties. If the output is inside a feature dataset, the coordinate system, as well as the XY and Z properties (except Z awareness), will always be that of the feature dataset.
- Output Coordinate System
- XY Tolerance
- Z Tolerance
- XY Resolution
- Output XY Domain
- Default Output Z Value
- Output has Z Values
- Z Resolution
- Output Z Domain
Legacy:
The XY Domain environment is only used for output in geodatabase created earlier than 9.3.
The following environments can be used regardless of whether the output is stand-alone or in a feature dataset:
For shapefile output, see Geoprocessing considerations for shapefile output.
Tools with multiple inputs—coordinate system affects tool performance
Geoprocessing tools that take multiple inputs, such as tools in the Analysis toolbox or Spatial Analyst toolbox, require all features or rasters to be in a common coordinate system to compute spatial relationships. Consider the Intersect tool, which computes the geometric intersection of multiple feature classes. Suppose that five feature classes are specified as input; the first feature class input has a UTM coordinate system while the remaining four feature classes have an Albers coordinate system. Because the first feature class is in UTM, the features in the other four feature classes will first be projected from Albers to UTM by the Intersect tool before it begins processing them. Projecting these datasets can significantly degrade performance; it may be far more efficient to project the one feature class from UTM to Albers rather than four feature classes from Albers to UTM. Conversely, if the feature class in UTM has many features compared to the total number of features in the other four feature classes, it would be more efficient to project the other feature classes from Albers to UTM.
To improve performance of the above situation, you can employ one of two techniques:
- Set the geoprocessing output coordinate system environment to the appropriate coordinate system (Albers in the above example). Anytime the output coordinate system environment is specified, it is recommended that you specify an appropriate geographic transformation, if necessary.
- Ensure the first geodataset input to the tool contains the coordinate system that will minimize the amount of data being projected (Albers in the above example).
Avoid unknown coordinate systems
Processing data with an appropriate coordinate system allows better default values for tolerance, resolution, and domains.
You should avoid processing data with an unknown coordinate system because the default tolerances may not be appropriate for the tool. The XY Tolerance default for an unknown coordinate system is 0.001 units—this is an exceedingly large value if the data's coordinates are in a geographic coordinate system where one unit (decimal degrees) represents up to 110 kilometers distance on the earth's surface, meaning the tolerance used for processing could be as large as 110 meters.
Coordinate system affects tool result
The spatial or topological relationship shared by two geometries in one coordinate system may change when projected to a different coordinate system. For example, the illustration below shows a blue line that connects the cities of Jakarta and Wellington. Depending on the coordinate system in which the data is projected and processed, the blue line connecting the two cities may or may not intersect the city of Alice Springs. It is important to choose a coordinate system that is appropriate for the data.