The problem I described is solved. 
The reason for the trouble was that after the conversion to geotiff, the 
metadata stayed there (which is desired - I at least easily know which band
contains which data). 
After creating the ImageMosaic Geoserver probably reads this metadata and 
assumes it is still a grib file and suggests NetCDFImageReaderSPI to read 
it. Which then returns 0.0 as value of GetFeatureInfo everywhere without any
log error after Layer Preview is launched. 

For someone who might need this in the future:

Currently two options come to my mind how to solve this: either add -nomd 
option to gdalwarp to not copy metadata to the resulting geotiff or after 
the mosaic is created, manually change a row in "mosaicname.properties" 


SuggestedSPI=org.geotools.imageio.netcdf.NetCDFImageReaderSpi 

to 




SuggestedSPI=it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi 

I think the general assumption of (how I imagine it happens underneath) 
image mosaic taking the metadata and saying, it has grib metadata, I am 
going to treat it as grib even though it is geotiff is wrong, but I also 
presume it would be quite hard and lengthy process to catch this edge case
in the code. 




Best,

Lubomír Bucek




---------- Původní e-mail ----------
Od: Lubomír Bucek <[email protected]>
Komu: [email protected]
Datum: 20. 7. 2018 18:59:08
Předmět: Geotiff mosaic
"Dear all, 
I am experiencing trouble implementing a geotiff image mosaic store. 
I have got meteorological .grib2 data, which I converted to geotiff using
gdalwarp with following command

gdalwarp -overwrite -t_srs EPSG:3857 --config CENTER_LONG 0 -wo SOURCE_EXTRA
=50 infile outfile


I know that grib mosaic can be served using geoserver too, but I chose to 
convert to geotiff to enable creating contours and current arrows in the 
lat/lon range of -180,180 instead of 0,360 (which is my source data bounding
box). I will also be serving the data using WMS in webmercator (EPSG: 3857),
so this way I am preventing a coordinate transformation on the fly. I do not
know if the performance gain will be mentionable, but nevermind, I did not
figure out a way to create contours outside of 0,360 of the source grib 
anyway. 



I tried using both shapefile and postgresql datastore for indexing - in both
cases, I think it gets indexed properly, entries appear in the database / 
shapefile with corrent timestamp. Creating a store and a coverage view (one
or more bands) does not produce any error. I am able to select time as a 
dimension, but when I try to preview the layer I get a blank image with 
GetFeatureInfo returning 0.0 inside the coordinate bounds of the data
without any errors in log. I am able to see the images and data via
GetFeatureInfo from a single geotiff store/layer using one of these geotiffs
correctly though, which is confusing. Gdalinfo -stats also correctly sees 
all the bands with the value statistics.

I am using default open layers preview of geoserver to display it. I also 
tried to specify the time in the WMS query to match the image timestamp 
using &time=2018-07-20T12:00:00.000Z even though I did set "Use the smallest
domain value" as default value. This also made no change. 



The data, properties and screenshots are possible for download here: 
https://www.dropbox.com/sh/2a16rh5e8moeech/AAD2Xc_0iwU4XcUnQIEGbZ85a?dl=0
Is it possible by any chance, that someone came to a same problem or at 
least could point me to something, I might have overlooked? 
*
GeoServer Version
2.14-SNAPSHOT
*
Git Revision
b2596b12fa705eec4969d040b5dc57947b6de70f
*
Build Date
10-Jul-2018 09:06
*
GeoTools Version
20-SNAPSHOT (rev 010ae3c319b600cd6a53292836c341fb7447fc26)                

Best, Lubomír Bucek

"
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to