Summary
Makes a feature layer from a netCDF file.
Usage
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.
Layers created in ArcCatalog cannot be used in ArcMap unless they are saved to a layer file using the Save To Layer File 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.
Syntax
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})
Parameter | Explanation | Data 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. This default value can also be altered on the netCDF tab of the Layer Properties dialog box.
| Value Table |
value_selection_method (Optional) | Specifies the dimension value selection method.
| 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