I have a bunch of GeoTIFF files that I'm putting into an ImageMosaic in GeoServer. Each image corresponds to one day, and I have been able to successfully import the images into GeoServer such that I can indeed query for specific images via a WCS call using "cql_filter". The datafiles stored on the server have some metadata tags in them, including one that indicates the file's date. However, I have noticed that when I use WCS to get an image back, the metadata tags in the received file are different - the tags in the original file are not preserved.

Is there a way to configure GeoServer/ImageMosaic to cause it to write the value in the "timestamp" field of the database associated with the ImageMosaic into the file? The reason for this is that I've noticed that if no date value is specified (or if the query has a date value not matching an ingested image) that it will return an image, but it's not always clear exactly which image it is. Having the timestamp information in the file itself would make it clear what the date is for that file.

I posted this question on the GeoServer mailing list, and got an answer that I may need to use a WPS process, but I'm not sure if that will really help; if the file being passed into WPS has an "unknown" datetime, WPS won't be able to correctly add it. And I don't want the date from the query just blindly put into the file, as it may be a different date that is actually returned.

Any insight on this? I'm running GeoServer v2.15.0 (I know it's not the most recent, but upgrading may not be possible for the near future, though may happen sometime down the road).

1 Answer 1


That's currently not possible.

The GeoServer WCS code itself has no idea where the pixels are coming from, it's all hidden behind interfaces, GeoTIFF, NetCDF or ArcGrid all look the same. Data goes through an image processing chain before being encoded in the output format of choice, the information you're looking for is lost the moment that data is read from the source.

It is conceivable to preserve the original tiff tags, for cases when there is a single source image extracted from the mosaic, but it would require coding, at various level (at least GeoTools and GeoServer, maybe also imageio-ext). Check out this guide if you intend to make it happen: https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-fixes,-improvements-and-new-features-in-GeoServer

  • Thanks for the feedback. In our specific case, each image returned will indeed be coming from a single source image, so I will look at the page you link to and see where that leads me. I can definitely see now that in cases where the output image may be coming from multiple source images, a universal "timestamp" may not make sense, depending on how a given mosaic is setup. Commented Mar 15, 2022 at 16:14

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.