Select to view content in your preferred language

NetCDF Voxel Layer Symbology Issue in ArcGIS Pro 3.4

91
2
Jump to solution
yesterday
Matteo_Censi
New Contributor

Hello all,
I am generating a 3D categorical voxel model (.nc file) from point data using a custom Python script and the netCDF4 library. I am using proprietary ESRI attributes to enforce discrete symbology (Unique Values) upon loading the layer in ArcGIS Pro.

While the unique values and labels are successfully loaded, the colors fail to apply automatically.

My goal is to load the Voxel Layer with correct Labels AND Colors applied automatically.

Data Type: Categorical codes stored as unsigned 8-bit integers (u1 / uint8).
Dimensions: 3D Voxel (z, y, x).
_FillValue: 255 (as uint8).

The main variable, sediment_code, is defined with the following attributes:
esri_unique_values np.array([...], dtype='u1') -> WORKS
esri_unique_labels np.array(['Su Extremely Low', ...], dtype=str) -> WORKS
esri_unique_colors RGBA String -> FAILS (Colors not applied)
flag_values / flag_meanings CF Standard -> WORKS

Here is how the main variable is created and the key attributes are assigned in the script that successfully loads the labels:

# Assuming cf_flag_values (dtype='u1'), flag_descriptions, and rgba_string are correctly calculated

# Variable creation using u1 (uint8)
sed_var = ncfile.createVariable(
    'sediment_code', 
    'u1',           # Unsigned 8-bit integer (working type)
    ('z', 'y', 'x'), 
    fill_value=255,   # Working FillValue
    zlib=False      
)

# ... other essential attributes (standard_name, coordinates, grid_mapping)

# ArcGIS Pro Proprietor Attributes (Symbology)
sed_var.esri_unique_values = cf_flag_values
sed_var.esri_unique_labels = np.array(flag_descriptions, dtype=str)
sed_var.esri_unique_colors = rgba_string # <--- The failing attribute

# Example of RGBA string format (partially):
# "217 225 242 255 180 198 231 255 0 176 240 255 ..."

 

Given that esri_unique_values and esri_unique_labels are correctly read by ArcGIS Pro 3.x for this Voxel Layer, what could be the specific issue preventing esri_unique_colors from being applied?

Is there a required character limit, escaping rule, or specific formatting (e.g., using commas instead of spaces) for the RGBA string when defining colors for u1 variables?

Does the Voxel Layer symbology require the colors to be stored in a different dimension/variable rather than as an attribute?

Any guidance on the exact syntax or known limitations for the esri_unique_colors attribute on Voxel Layers would be greatly appreciated.
Thank you!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Andrew--Johnson
Esri Regular Contributor

Hi,

Where did you see that esri_unique_colors is a supported attribute?

Currently, this is only supported for continuous values through the esri_color_ramp attribute in the official documentation.

https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/voxel-layer-symbology.htm#ESR... 

thanks,

Andrew

View solution in original post

0 Kudos
2 Replies
Andrew--Johnson
Esri Regular Contributor

Hi,

Where did you see that esri_unique_colors is a supported attribute?

Currently, this is only supported for continuous values through the esri_color_ramp attribute in the official documentation.

https://pro.arcgis.com/en/pro-app/latest/help/mapping/layer-properties/voxel-layer-symbology.htm#ESR... 

thanks,

Andrew

0 Kudos
Matteo_Censi
New Contributor

Oh! Thank you for the clarification!

This confirms my suspicion that the esri_unique_colors attribute is not supported for discrete Voxel Layers (Unique Values) in ArcGIS Pro.

Since esri_unique_labels works perfectly, allowing the automatic loading of sediment descriptions, I will try with this workflow:

1. Manually setting the symbology and saving it to a .lyrx file once.
2. Using ArcPy in my Python script to apply the colors automatically after loading the NetCDF file.

This should addresses the issue completely. Thanks again for your prompt and helpful response!

Best regards.