# Spatial reference for netCDF data

You can select either dimensions or coordinate variables to specify X and Y dimensions (or variables) when creating a netCDF raster or feature layer from a netCDF variable. Spatial reference of the data created from a netCDF variable is determined by the units of the coordinate variables and whether or not the grid_mapping attribute exists.

If the units of the coordinate variables specified as the x- and y-dimensions are the units of longitude and latitude, respectively, then the data is in geographic coordinate systems (GCS). The acceptable units for longitude are degrees_east, degree_east, degrees_E, degree_E, degreesE, and degreeE. Similarly, the acceptable units for latitude are degrees_north, degree_north, degrees_N, degree_N, degreesN, and degreeN.

If the standard_name of the coordinate variables specified as the x- and y-dimensions are projection_x_coordinate and projection_y_coordinate, respectively, and the variable has a grid_mapping attribute, then the data is in projected coordinate systems (PCS). The projection name, type, and other parameters are defined by a grid mapping variable.

If the units or standard_name of the coordinate variables do not satisfy the criteria of the geographic or projected coordinate system stated above, then the spatial reference of the data is considered unknown or undefined. For example, if you create a raster using an x-coordinate variable with appropriate standard_name as x-dimension and altitude dimension as y-dimension, the spatial reference will be unknown.

The CF conventions specifies some elements of the coordinate system but not how to include the geographic coordinate system (datum) portion. Because of this, it is always assumed to be the WGS 1984, whether the data is referenced to a projected or geographic coordinate system. A projected coordinate system is based on a geographic coordinate system and must always be specified. Because of the assumption of WGS 1984, data that is actually referenced to a particular sphere or another spheroid (ellipsoid) may not align with other data layers.

Learn more about grid mapping and projections in the NetCDF Climate and Forecast (CF) metadata conventions.