Closed ihor-hrechka closed 7 years ago
Well, I think that convert float32 data into an image isn't an issue. 4 bytes data can be converted into Red, Green, Blue and Alpha 8 bits image. If you read IEE 754, you'll understand that the image resulting from the conversion will give a very strange and erratic image and as geoserver will smooth the image before serve it, the result after using the Cesium-GeoserverTerrain provider will be anormal (euphemism...). So you shouldn't use image in order to cache your data.
Thanks for your answer! Will continue search the way of caching in image/bill format. I checked sources of GeoWebCache and seems found bil16 and bil32 support there.
@kaktus40 , sorry, you mentioned "So you shouldn't use image in order to cache your data", but that SLD approach and GeotiffTranslate one you described. Is there any way to encode elevation values into RGB on geoserver side, and decode them on client side with JS?
I tried SLD approach and GeotiffTranslate aproaches, but getting incorrect values, either reading only RG bytes, or reading all 4 bytes from the returned 32 bit arraybuffer.
thanks in advance.
Sorry, I don't understand your post. I wrote "So you shouldn't use image in order to cache your data" for a 32 bit data respecting IEE 754 (float data). But for integer values, there is no issue. I don't understand what you mean by "encode elevation values into RGB geoserver side". do you mean "converting on the fly" or "caching"? In the first case, I don't know all the plugins of geoserver. What is your purpose?
I need to get elevation data from geotif, served by geoserver, but without using BIL extension (because bil tiles not supported by geowebcache). I though you described how to encode elevation values into RGB by means of SDL style and decode them on client. By the way, am not using cesium, it is for custom 3d map, so I need to get array buffer and decode RGB values.
I mean something like this https://www.mapbox.com/help/access-elevation-data/ but encoding with geoserver
Well, you can create SLD to map colors to your data. It works for integer or long data types.
@kaktus40 , yep, I tried bitwise conversions (to rgb and from rgb), but no luck so far.
@kaktus40 , actually you're quite right, I have succeeded to encode elevation values into RGB, and decode using PNG format. Just need to make sure that color ramp correspond min and max integer values.
thanks.
Hi!
I successfully converted my TIFF images in Float32 format and now picture looks perfect! Now I want to cache this layer but I didn't found image/bil format in list of available formats for caching in GeoWebCache. It allows to create cache in following formats:
But TerrainProvider request tiles in image/bil format and GeoWebCache return exception report with "wrong format (image/bil)" message.
Is there any ability to use TerrainProvider with cached tiles?
P.s. I saw your example with converting 16 bits grayscale images to RGB with applying of style. But my images not in 16 bit format but in 32 bit.
Thanks in advance!