GeoTIFF file background transparency

230
1
01-14-2019 08:00 PM
Highlighted
New Contributor

I am using this ArcGIS Runtime SDK for .NET Code Sample code to show a GeoTIFF file on my map. Some parts of my GeoTIFF file does not include any image and should display transparent.

The SDK shows the GeoTIFF file on map fine except the fact that the area that should display transparent are showing black, and users cannot see what is on the underneath map.

Is there any way to tell the SDK to show the GeoTIFF background transparent instead of black?

Tags (2)
Reply
0 Kudos
1 Reply
Highlighted
Esri Frequent Contributor

Hi,

Currently there is no API feature for specifying the transparent pixel value, but you could try applying a mask function via a JSON definition:

{
"raster_function":{"type":"Mask_function"},
"raster_function_arguments":
{
"nodata_values":{"double_array":[value1, value2, ..., valueN],"type":"Raster_function_variable"},
"nodata_interpretation":{"nodata_interpretation":"all","type":"Raster_function_variable"},
"raster":{"name":"raster","is_raster":true,"type":"Raster_function_variable"},
"type":"Raster_function_arguments"
},
"type":"Raster_function_template"
}

Shown in sample: arcgis-runtime-samples-dotnet/RasterLayerRasterFunction.xaml.cs at master · Esri/arcgis-runtime-samp... 

Cheers

Mike

Reply
0 Kudos