0

I have created a four-band raster dataset (true color surface data) using ArcMap 10.8.1, wherein the fourth band serves as the alpha band. The dataset includes external pyramid files (.ovr), as illustrated in the following diagram: enter image description here

After publishing this dataset as a WMS service using the World Image method, the Alpha band functions correctly, enabling the data to display properly. The "invalid areas" around the edges appear transparent, consistent with how the data is displayed within ArcMap.

However, when the same dataset is published as a WMS service using the Image Mosaic method, the Alpha band fails to take effect, resulting in black regions around the edges of the data, as depicted in the following illustration: enter image description here

When attempting to configure the "Output Transparent Color" property to black in the layer settings interface, the entire raster fails to display, albeit clicking on the map area still returns raster values. enter image description here enter image description here

I am curious as to why this issue occurs and how to address this situation.

2024/6/7 Update on the issue: I have identified that the pyramids of the data are the primary cause behind the black areas in the imagery. Specifically, when zooming into the edges of the layer to a certain scale, those black regions vanish. Details are illustrated in the attached figure below.

before zoom enter image description here

after zoom enter image description here

13
  • 2
    Since you have an alpha band you should not specify a transparent colour as I suspect that causes the code to ignore the alpha band
    – Ian Turton
    Commented Jun 6 at 10:49
  • 2
    Works for me with GeoServer 2.24.3. I warped one orthophoto for getting some nodata areas, added .ovr file with gdaladdo -ro testortho.tif, created an ImageMosaic store, published the layer with default values. Could you create and share one small TIFF file for testing?
    – user30184
    Commented Jun 6 at 14:40
  • @user30184 Thank you for taking notice of my question.I'm unsure how to share my data with you. If you could provide me with your email address, I can send the data to you via email. Meanwhile, while preparing the data you requested, I discovered that the black areas are due to the external pyramid files associated with the raster. Specifically, when zooming into the edge of the valid data area, the black regions disappear at a certain zoom level. I'm unsure if this finding is helpful in resolving the issue.
    – 苏云明
    Commented Jun 7 at 3:12
  • @IanTurton Thank you for taking notice of my question.I understand what you mean now. I've realized that the issue is related to the pyramids of the data, but I'm unsure how to address it.
    – 苏云明
    Commented Jun 7 at 3:18
  • @user30184 I have appended the screenshots of the results to the question I posted. You may take a look at them now.
    – 苏云明
    Commented Jun 7 at 3:19

2 Answers 2

1

I show step by step what works for me.

  • Have some orthophoto. I found this that I could downloaded with a direct link

https://geoportaal.maaamet.ee/index.php?lang_id=2&plugin_act=otsing&kaardiruut=44744&andmetyyp=ortofoto_eesti_rgb&dl=1&f=44744_OF_RGB_GeoTIFF_1999.zip&no_cache=666818407af77&page_id=662

  • Warp the orthophoto into some other CRS that so that the image will be rotated. That creates nodata triangles at the edges. Add alpha band by the same. With this image target CRS EPSG:3857 seems to work.

gdalwarp -t_srs epsg:3857 -co tiled=yes -co compress=lzw -dstalpha 44744.tif 44744b.tif

  • Add external overviews

gdaladdo -ro 44744b.tif

  • Make an ImageMosaic store into GeoServer and publish the layer. See how the result looks in the layer preview. Pay attention to the white triangles (the large black area is a part of the source image).

enter image description here

3
  • Based on my testing, I was able to replicate your results using your approach. I examined the differences in the data and ultimately pinpointed the issue with the Alpha band recognition.
    – 苏云明
    Commented Jun 13 at 2:35
  • 1
    When exporting a four-band raster (including the Alpha band) using ArcGIS Pro's raster export method, the external pyramids it generates do not handle the Alpha band appropriately, leading to incorrect rendering in GeoServer.
    – 苏云明
    Commented Jun 13 at 2:35
  • 1
    My solution involved the following steps: removing the pyramid files created by ArcGIS Pro, then utilizing the gdaledit tool to assign color interpretations to each band (-colorinterp_1 red -colorinterp_2 green -colorinterp_3 blue -colorinterp_4 alpha). After this, I reconstructed the pyramids either using ArcGIS Pro or the gdaladdo command. This approach ensured that GeoServer could then correctly display areas designated as transparent.
    – 苏云明
    Commented Jun 13 at 2:36
0

thanks to user30184 for his assistance; with his help, I was able to identify the root cause of my issue. I discovered a problem with the four-band raster datasets created by ArcGIS Pro, which include an alpha band: bands 1 through 3 were not defined as to what type of bands they represent. After reading the problematic raster bands using GDAL, the information displayed was as follows. enter image description here

After modifying the color interpretation of each band using the gdaledit tool or via Python, and subsequently rebuilding the pyramids using either the ArcGIS tool or the gdaladdo command, the issue was resolved. enter image description here

I speculate that the fundamental issue stemmed from the undefined color interpretation of the bands, which led to problems during the creation of raster pyramids. Concurrently, I am also curious about how others perceive or have experienced this particular issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.