Make NetCDF Feature Layer (Multidimension)

Summary

Makes a feature layer from a netCDF file.

Usage

  • This tool supports netCDF file with nc and nc4 extensions. The group variables and dimensions within a group in a nc4 file are not supported. Only the variables and dimensions outside of the group are supported.

  • For very large netCDF files, there may be a delay between tool completion and the initial draw of the netCDF layer. Subsequent drawing of the layer will not have a delay.

  • The netCDF feature layer can be used as input to any geoprocessing tool that accepts a feature class as input.

  • The temporary feature layer can be saved as a layer file using the Save To Layer File tool or saved as a new feature class using the Copy Features tool.

  • An existing feature layer will be overwritten if the same layer name is specified.

  • Auxiliary coordinate variables are listed in the X Variable and Y Variable drop-down lists and used during execution if specified. They are not listed in the Dimension Values parameter drop-down list and cannot be set as the value of this parameter at the command line or in a script.

  • The number of features in the layer is the same as the number of unique values in the row dimension. If multiple dimensions are selected, then the number of records is the product of the number of unique values in those dimensions.

  • Only one feature is created when a row dimension is not specified.

  • The type of field is determined by the netCDF variable type.

  • The first value of a non-row dimension is used to create a default view of a multidimensional variable.

  • The calendar attribute values noleap and 365_day, assigned to the time coordinate variable of the netCDF file, are not honored in ArcGIS.

Parameters

LabelExplanationData Type
Input netCDF File

The input netCDF file.

File
Variables

The netCDF variable, or variables, that will be added as fields in the feature attribute table.

String
X Variable

A netCDF coordinate variable used to define the x, or longitude, coordinates of the output layer.

String
Y Variable

A netCDF coordinate variable used to define the y, or latitude, coordinates of the output layer.

String
Output Feature Layer

The name of the output feature layer.

Feature Layer
Row Dimensions
(Optional)

The netCDF dimension, or dimensions, used to create features with unique values in the feature layer. The dimension or dimensions set here determine the number of features in the feature layer and the fields that will be presented in the feature layer's attribute table.

For instance, if StationID is a dimension in the netCDF file and has 10 values, by setting StationID as the dimension to use, 10 features will be created (10 rows will be created in the feature layer's attribute table). If StationID and time are used, and there are 3 time slices, 30 features will be created (30 rows will be created in the feature layer's attribute table). If you will be animating the netCDF feature layer, it is recommended, for efficiency reasons, to not set time as a row dimension. Time will still be available as a dimension that you can set to animate through, but the attribute table will not store this information.

String
Z Variable
(Optional)

A netCDF variable used to specify elevation values (z-values) for features.

String
M Variable
(Optional)

A netCDF variable used to specify linear measurement values (m-values) for features.

String
Dimension Values
(Optional)

The value (such as 01/30/05) of the dimension (such as Time) or dimensions to use when displaying the variable in the output layer. By default, the first value of the dimension or dimensions will be used.

  • Dimension—A netCDF dimension.
  • Value—The dimension value to use.
Value Table
Value Selection Method
(Optional)

Specifies the dimension value selection method that will be used.

  • By valueThe input value is matched with the actual dimension value.
  • By indexThe input value is matched with the position or index of a dimension value. The index is 0 based; that is, the position starts at 0.
String

arcpy.md.MakeNetCDFFeatureLayer(in_netCDF_file, variable, x_variable, y_variable, out_feature_layer, {row_dimension}, {z_variable}, {m_variable}, {dimension_values}, {value_selection_method})
NameExplanationData Type
in_netCDF_file

The input netCDF file.

File
variable
[variable,...]

The netCDF variable, or variables, that will be added as fields in the feature attribute table.

String
x_variable

A netCDF coordinate variable used to define the x, or longitude, coordinates of the output layer.

String
y_variable

A netCDF coordinate variable used to define the y, or latitude, coordinates of the output layer.

String
out_feature_layer

The name of the output feature layer.

Feature Layer
row_dimension
[row_dimension,...]
(Optional)

The netCDF dimension, or dimensions, used to create features with unique values in the feature layer. The dimension or dimensions set here determine the number of features in the feature layer and the fields that will be presented in the feature layer's attribute table.

For instance, if StationID is a dimension in the netCDF file and has 10 values, by setting StationID as the dimension to use, 10 features will be created (10 rows will be created in the feature layer's attribute table). If StationID and time are used, and there are 3 time slices, 30 features will be created (30 rows will be created in the feature layer's attribute table). If you will be animating the netCDF feature layer, it is recommended, for efficiency reasons, to not set time as a row dimension. Time will still be available as a dimension that you can set to animate through, but the attribute table will not store this information.

String
z_variable
(Optional)

A netCDF variable used to specify elevation values (z-values) for features.

String
m_variable
(Optional)

A netCDF variable used to specify linear measurement values (m-values) for features.

String
dimension_values
[[dimension, {value}],...]
(Optional)

The value (such as 01/30/05) of the dimension (such as Time) or dimensions to use when displaying the variable in the output layer. By default, the first value of the dimension or dimensions will be used.

  • dimension—A netCDF dimension.
  • {value}—The dimension value to use.
Value Table
value_selection_method
(Optional)

Specifies the dimension value selection method that will be used.

  • BY_VALUEThe input value is matched with the actual dimension value.
  • BY_INDEXThe input value is matched with the position or index of a dimension value. The index is 0 based; that is, the position starts at 0.
String

Code sample

MakeNetCDFFeatureLayer example 1 (Python window)

Creates a feature layer from a netCDF file.

import arcpy
arcpy.MakeNetCDFFeatureLayer_md("C:/data/netcdf/rainfall.nc",
                                "pptx","longitude","latitude","rainfall",
                                "station")
MakeNetCDFFeatureLayer example 2 (stand-alone script)

Creates a feature layer from a netCDF file.

# MakeNetCDFFeatureLayer_Ex_02.py
# Description: Create a feature layer from a netCDF file.
# Requirements: None

# Import system modules
import arcpy

# Set local variables
inNetCDFFile = "C:/data/netcdf/rainfall.nc"
inVariables = "pptx"
inXVariable = "longitude"
inYVariable = "latitude"
outFeatureLayer = "rainfall"
rowDimensions = "station"
ZVariable = ""
MVariable = ""
dimensionValues = ""
valueSelectionMethod = ""

#Execute MakeNetCDFFeatureLayer
arcpy.MakeNetCDFFeatureLayer_md(inNetCDFFile, inVariables, inXVariable, 
                                inYVariable, outFeatureLayer, rowDimensions, 
                                ZVariable, MVariable, dimensionValues, 
                                valueSelectionMethod)

Environments

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics