2

I have two image mosaic layers of geotiffs. One contains aerial photos, the other contains rasterized vector data, meant as an overlay.

Creating a layer group of these two produces an unpleasant result - jagged edges with black patches:

enter image description here

Expected result (acquired by gluing the overlay to the photo in GIMP):

enter image description here

The overlay is mostly transparent, and the vectors have been rendered using anti-aliasing on alpha channel. When I open just the overlay layer in the built-in GeoWebCache demo, the result is as I expect:

enter image description here

Opening the source TIFF in e.g. GIMP confirms that the anti-alias shading is indeed done against alpha channel, and that there is no background color in the TIFF file.

Close-up of rendered layer group - transparent pixels are not rendered correctly:

enter image description here

What could be causing those black/dark pixels and how might I fix it?

What I have tried:

  • enabling JAI-ext
  • setting layers' MergeBehavior to STACK vs. FLAT
  • playing with InputTransparentColor & OutputTransparentColor

Style is default raster.

EDIT: added actual/expected end results


Output of gdalinfo for one overlay geotiff:

Driver: GTiff/GeoTIFF
Files: overlay.tif
Size is 12000, 12000
... clipped CRS info
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
... clipped coordinates
Band 1 Block=12000x1 Type=Byte, ColorInterp=Red
  Mask Flags: PER_DATASET ALPHA 
Band 2 Block=12000x1 Type=Byte, ColorInterp=Green
  Mask Flags: PER_DATASET ALPHA 
Band 3 Block=12000x1 Type=Byte, ColorInterp=Blue
  Mask Flags: PER_DATASET ALPHA 
Band 4 Block=12000x1 Type=Byte, ColorInterp=Alpha

gdalinfo for an aerial photo:

Driver: GTiff/GeoTIFF
Files: aero.tif
Size is 12000, 12000
Coordinate System is:
... clipped CRS info
Pixel Size = (0.500000000000000,-0.500000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  SOURCE_COLOR_SPACE=YCbCr
  COMPRESSION=YCbCr JPEG
  INTERLEAVE=PIXEL
Corner Coordinates:
... clipped coordinates
Band 1 Block=256x256 Type=Byte, ColorInterp=Red
  Overviews: 6000x6000, 3000x3000, 1500x1500, 750x750, 375x375
Band 2 Block=256x256 Type=Byte, ColorInterp=Green
  Overviews: 6000x6000, 3000x3000, 1500x1500, 750x750, 375x375
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue
  Overviews: 6000x6000, 3000x3000, 1500x1500, 750x750, 375x375

Version information:

GeoServer Version
2.12.0
Git Revision
bc18e09993a30c93f37b7e33e7c54c32b17e014b
Build Date
12-Oct-2017 07:54
GeoTools Version
18.0 (rev 91315ffe07add4d70567a36802e5813e9cc75fa0)
GeoWebCache Version
1.12.0 (rev 1.12.x/6fa967943b81ffff4b46b2ac8d5529f82ed15bed)
  • I think once you have zoomed in that far it will always look odd. Why not draw the vector layer as vectors to avoid this issue? – Ian Turton Dec 21 '17 at 15:09
  • 1
    Could you also share the base layer tile? – Andrea Aime Dec 21 '17 at 16:25
  • @IanTurton I added a less zoomed-in comparison, I hope this makes it clearer. I don't have the original vectors. – stalemate Dec 22 '17 at 9:05
  • @AndreaAime the images were just cropped screenshots, do you want the actual tile or a screenshot without the overlay? Please see the comparison of actual/expected I just added. – stalemate Dec 22 '17 at 9:08
  • You have the zoomed in overlay and the composition, but not the background raster, that's what I wanted to see. That said, the composition is made by Java itself using normal alpha processing so I'm not sure there are workarounds. You might want to open a bug report sharing a sample of the two layers and the eventual styles in use (enough for a developer to reproduce on their machine) – Andrea Aime Dec 22 '17 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.