Make NetCDF Feature Layer (Multidimension)

Summary

Makes a feature layer from a netCDF file.

Usage

Syntax

MakeNetCDFFeatureLayer_md (in_netCDF_file, variable, x_variable, y_variable, out_feature_layer, {row_dimension}, {z_variable}, {m_variable}, {dimension_values}, {value_selection_method})
ParameterExplanationData 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.

  • BY_VALUE The input value is matched with the actual dimension value.
  • BY_INDEX The 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 = "c:/output/rainfall"
rowDimensions = "station"
ZVariable = ""
MVariable = ""
dimensionValues = ""
valueSelectionMethod = ""

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

Environments

Related Topics

Licensing Information

ArcView: Yes
ArcEditor: Yes
ArcInfo: Yes

6/6/2013