ImageMosaic timeregex.properites not reading correctly

Hello,
I’m trying to setup an ImageMosaic raster store to serve hourly rasters, following the instructions here: ImageMosaic

My rasters are titled like so, in a director called rasters/
qpe_20241004060000.tif
qpe_20241004070000.tif
qpe_20241004080000.tif

My timeregex.properites looks like

regex=([0-9]{14}),format=yyyyMMddHHmmss

My indexer.properties looks like:

TimeAttribute=ingestion
ElevationAttribute=elevation
Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date,elevation:Integer
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion)

however, when I try to create the store, my dbf file doesn’t seem read the timestamps correctly, it looks like:
image

so it doesn’t seem to picking up the timestamp.
I’ve tried a variety of other regex’s too and nothing seems to work.
What am i doing wrong?

Geoserver version 2.26.0

Hi,
Storing the time part of a Date is not supported in the DBF3 specification (Shapefile uses that).
However, you can setup a system property to enable that. You may find more details on the shapefile plugin page.

https://docs.geotools.org/stable/userguide/library/data/shape.html

Quoting from that page:
Dates do not support the storage of time by default. If you must store time stamps and do not need interoperability then you can enable the storage of time in date columns by setting the system property org.geotools.shapefile.datetime to “true”. Almost no other program will be able to read these files.

Note that in the above quote I have remarked “Do not need interoperability” since setting that will have WFS generating shapefile that are not valid.
If that’s a concern, you may want to use a DBMS instead of shapefile for imageMosaic indexing.
https://docs.geoserver.org/main/en/user/data/raster/imagemosaic/configuration.html#datastore-properties

Hope this helps.

1 Like

D’oh! I should’ve known it was the Curse of the Shapefile! Thanks danieleromagnoli! Just moving it to postGIS did the trick for me.