Label | Explanation | Data Type |
Input Features | The input point features. | Feature Layer |
Fields to Variables | The field or fields that will be used to create variables in the netCDF file. Four special fields—Shape.X, Shape.Y, Shape.Z, and Shape.M—can be used for exporting x-coordinates or longitude, y-coordinates or latitude, z-values, and m-values of input features, respectively.
| Value Table |
Output netCDF File | The output netCDF file. The file name must have an .nc extension. | File |
Fields to Dimensions (Optional) | The field or fields that will be used to create dimensions in the netCDF file.
| Value Table |
Summary
Converts point features to a netCDF file.
Usage
The default variable name is the same as the input feature field name specified in the Fields to Variables parameter (fields_to_variables in Python).
The type of variable is the same as the type of field.
Special fields Shape.X and Shape.Y are always available in the Fields to Variables drop-down list. They can be used for specifying variable names for x-coordinates and y-coordinates, respectively. If variable names are not specified or Shape.X and Shape.Y are not added to the list, the x- and y-coordinates are exported with default variable names. The default Variable names for Shape.X and Shape.Y are lon and lat, respectively, when the feature is in a geographic coordinate system. In all other cases, the default Variable names for Shape.X and Shape.Y are x and y, respectively.
Special fields Shape.Z and Shape.M are available in the Fields to Variables drop-down list for features with z- and m-values. To export z- and m-values, you must add Shape.Z and Shape.M to the list. The default Variable names for Shape.Z and Shape.M are z and m, respectively.
The default dimension name is the same as the input feature field name specified in the Fields to Dimensions parameter (fields_to_ dimensions in Python).
The size of a dimension is equal to the number of unique values in the respective field.
If no field is specified as a row dimension, a dimension RecordID value is created in the output netCDF file with a size equal to the number of features.
String fields cannot be used to create dimensions in the netCDF file.
When multiple fields are used to create dimensions in the netCDF file using the Fields to Dimensions parameter, the output netCDF file may become large in size. Ensure that there is enough space in the output location to avoid tool failure.
The tool writes variables as Discrete Sample Geometry (DSG), such as points or trajectory, following the CF conventions. Since, this data is not gridded, the variables in the output netCDF file are not suitable for creating a voxel layer.
Parameters
arcpy.management.FeatureToNetCDF(in_features, fields_to_variables, out_netCDF_file, {fields_to_dimensions})
Name | Explanation | Data Type |
in_features | The input point features. | Feature Layer |
fields_to_variables [[field, {variable}, {units}],...] | The field or fields that will be used to create variables in the netCDF file. Four special fields—Shape.X, Shape.Y, Shape.Z, and Shape.M—can be used for exporting x-coordinates or longitude, y-coordinates or latitude, z-values, and m-values of input features, respectively.
| Value Table |
out_netCDF_file | The output netCDF file. The file name must have an .nc extension. | File |
fields_to_dimensions [[field, {dimension}, {units}],...] (Optional) | The field or fields that will be used to create dimensions in the netCDF file.
| Value Table |
Code sample
Converts a feature class to a netCDF file.
import arcpy
arcpy.FeatureToNetCDF_md("c:/data/spotelev.shp", [["Shape.X", "lon"],
"degree_east", ["Shape.Y", "lat", "degree_north"],
["elevation", "elevation", "meter"]],
"c:/output/pointelev01.nc", "id")
Converts a feature class to a netCDF file.
# FeatureToNetCDF_Ex_02.py
# Description: Converts a feature class to a netCDF file.
# Requirements: None
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data/netcdfgisdata"
# Set local variables
inFeatures = "spotelev.shp"
fieldToVariable = [["Shape.Y", "lat", "degree_north"],
["elevation", "elevation", "meter"]]
outNetCDFFile = "c:/output/pointelev02.nc"
fieldToDimension = "id"
# Execute FeatureToNetCDF
arcpy.FeatureToNetCDF_md(inFeatures, fieldToVariable, outNetCDFFile,
fieldToDimension)