3

I have a Sentinel-2 image published on my GeoServer.

When I preview the layer, I can see it changes coloring somehow as I zoom in / out.

You can see examples in images below (look at the scale values at image bottom).

This may be not a problem at all if I'm using a "flat" 2D map like OpenLayers, but in Cesium the result is very ugly because Cesium request tiles at different zomm level due to its globe representation. See last image.

What I need to do to avoid this if it is possible?

This is how GDAL generate the image:

gdalbuildvrt -separate "myfile.vrt" B12_20m.jp2 B8A_20m.jp2 B04_10m.jp2
gdal_translate -co BIGTIFF=YES "myfile.vrt" "myfile-t.tif"
gdalwarp -t_srs EPSG:4326 "myfile-t.tif" "myfile-final.tif"

enter image description here enter image description here enter image description here

enter image description here enter image description here enter image description here

2 Answers 2

0

GeoServer by default will apply a histogram stretch to your map, if you don't want that you should specify a specific color ramp to apply to all tiles, there is a full reference here.

0
0

The solution was to tile the image with gdal2tiles.py.

As the Sentinel-2 have about 10 meters/pixel, a level 14 pyramid was enought without loose resolution ( it's not like that... see below ).

The tif images I would go to publish in GeoServer have about 346M each.

The pyramid tile folder have a total of 130M. I think with GeoServer I would have both cost size because the GeoWebCache would create the tile pyramid anyway.

Seems good but...

I have to downgrade the image with gdal_translate -ot Byte -scale because gdal2tiles.py complains about the data size (float32).

Well...I heard some place that GeoServer will make 8bits tiles anyway (don't know).

The end result is very satisfactory and I finally have a homogeneous image at any zoom level with a acceptable resolution. WITHOUT GEOSERVER. Cesium can deal with TMS/XYZ directly. All I need is a simple http server.

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.