geoTIFF with Transparency/NoData

953
6
03-01-2023 04:02 AM
Labels (2)
NorbertThoden
Occasional Contributor III

Hi!

I want to load a geotiff as basemap (via class Raster, RasterLayer)
Unfortunately the transparent/NoData are displayed in black.

If i use the data in TilePackage (tpk) format instead, i works fine
(using TileCache, ArcGISTiledLayer).

  • Does someone know, how to overcome the issue?
  • Maybe anyone could be so kind to check the behaviour at V100.15?
    (Location: Bremen, Germany)

My System:
OpenSuse, Qt5.14, runtimeSDK V100.8. (I know a little bit old...)
MapExportEval.tif ist attached

(The whole workflow is described here: GeoTiff with transparency - Esri Community)

Thanks in advance!!!

0 Kudos
6 Replies
JamesBallard1
Esri Regular Contributor

Hi @NorbertThoden.

I see the same as you with your raster file. I tested with 100.15 and it happens there as well. I will check with our raster experts and get back to you.

JamesBallard1
Esri Regular Contributor

@NorbertThoden this looks like a bug. Please contact support so we can follow up on the fix. For now I've log an internal bug so we can investigate.

In the meantime, it's possible that another image format may honor the transparency properly. I don't know if that's the case, or if any other formats would work with your workflow.

NorbertThoden
Occasional Contributor III

Hi James!

Thanks for testing with 100.15.

I already check a few other formats, but without success 😞

As you suggested i created case/bug:
CASE #03283291 (ESRI Germany/Swiss)

Thanks

0 Kudos
JamesBallard1
Esri Regular Contributor

@NorbertThoden one of my colleagues recommended using a Raster mask function. That might work for this case as a workaround until we can address the bug.

https://developers.arcgis.com/qt/layers/add-raster-data/#create-a-raster-from-a-raster-function

https://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/mask-function.htm 

0 Kudos
NorbertThoden
Occasional Contributor III

Hi James!
I have some news:

I got support from ESRI Germany. Thexy regocnized that my MapExportEval.tif lacks NoData definition.
That could cause the black/white background instead of desired transparency. (see Properties_NoDataUndefined.JPG)

The improved approach performs the georeferencing first.
Afterwards a mask funtion has to put on the orginal scan (Mask.JPG)
The resulting "Mask_XY" layer has now the transpareny.
Finally that layer be export WITH "0" as NoData value (8BitUnsigned, LZW)
See Export.JPG

The exported file has NoData defined, is georeferenced, has nice colors, compact...
(see Properties_NoDataDefined.JPG)

And it works fine with the ArcGIS Runtime SDK (V100.8) in any relevant ojection (WebMerc, UTM 32632)

Thanks a lot

JamesBallard1
Esri Regular Contributor

@NorbertThoden thanks for the update. I do have some more news from our end as well. Looks like the tiff/GeoTiff workflow is a limitation of the format itself rather than an Esri bug. The mask function should get you what you need, but also has some limitations.

Unfortunately, for GeoTIFF/TIFF, there's no well-defined way of supporting transparency channel/band. This isn't an Esri bug, it's related to this particular format. 

In this case, I would recommend going with PNG route, which does support transparency in band 4.

The mask function would only allow you define a pixel as ON or OFF, will not give you transparency, i.e. percentage of "opaqueness".

For their test data, looks like they just need a way to set NoData, not percentage of transparency, so in theory, you could define a mask using band 4, but doing so would involve extra step, it may not perform as fast as PNG.

 

0 Kudos