Skip to content

PYR1-938: register weather and risk time series as ImageMosaics - #98

Draft
danielhvs wants to merge 3 commits into
mainfrom
PYR1-938-weather-risk-image-mosaics
Draft

PYR1-938: register weather and risk time series as ImageMosaics#98
danielhvs wants to merge 3 commits into
mainfrom
PYR1-938-weather-risk-image-mosaics

Conversation

@danielhvs

@danielhvs danielhvs commented Aug 14, 2026

Copy link
Copy Markdown

Register weather and risk time series as ImageMosaics instead of one layer per
timestep, so a single layer carries the whole time dimension.

  1. Fold every <layer>_<yyyyMMdd>_<HHmmss>.tif group in a directory into a
    per-parameter ImageMosaic directory before registration. Files are moved, not
    linked, so gis-file-seq does not register them twice. Untimestamped rasters,
    timestamped shapefiles (psps_zonal, fire_detections) and directories that are
    already mosaics are left alone.
  2. Declare the GRAY_INDEX band on mosaic coverages. Without band metadata the
    ncWMS GetTimeSeries request fails, which is the request that returns the
    whole series at a point in one call.
  3. Ship resources/ in the uberjar. The :resource-dirs ["src/sql"] override
    was dropping the whole resources/ tree, including the new mosaic property
    templates.
  4. Add the three ImageMosaic property templates (datastore, indexer,
    timeregex); the datastore uses the existing Tomcat JNDI PostGIS pool.
  5. Tests cover grouping, idempotency, late-arriving timesteps, existing mosaic
    directories, shapefile and untimestamped-raster passthrough, and the band
    declaration.

Frontend side: pyregence#1144 - PYR1-938 Read Point Info time series from
ImageMosaics
. Both have to
ship together - the frontend reads the series from the mosaics this PR creates.

Daniel Silva added 3 commits August 13, 2026 14:46
Weather and risk forecasts land as one GeoTIFF per timestep, so a 72-hour
cycle registers 72 layers instead of one layer with 72 timesteps. Spread
forecasts avoid this only because pyrecast-scripts builds their mosaic
directories before upload; nothing does that for weather and risk, whose
producers live in other codebases.

1. Add convert-time-series-to-imagemosaics!, which folds every flat group of
   `<layer>_<YYYYMMDD>_<HHMMSS>.tif` files into an ImageMosaic directory named
   after the group's layer prefix. Re-running only moves newly arrived
   timesteps, so a growing forecast cycle keeps folding in.
2. Gate it on a new :imagemosaic-workspaces config key, a vector of workspace
   regexes. Deployments that do not set it keep registering one layer per file.
3. Ship the datastore/indexer/timeregex templates as resources, and add
   "resources" to the uberjar's :resource-dirs, which had been overridden to
   src/sql and so dropped the whole directory from the jar.
4. Set group write on the directories and files geosync creates, since
   GeoServer runs as tomcat and writes its granule index alongside the
   GeoTIFFs.

Verified on geoserver-dev against a copy of gfs0p25/20260813_12: 1798 flat
GeoTIFFs folded into 10 mosaic directories, all 10 publishing a WMS time
dimension.
The `<layer>_<YYYYMMDD>_<HHMMSS>.tif` name is already the time-series
convention, so matching it is the opt-in and :imagemosaic-workspaces was
buying nothing. Weather and risk workspaces can be deregistered and
re-registered at will, so there was no migration to stage either.

Only rasters fold. The timestamped shapefiles under psps_zonal and
fire_detections keep publishing one layer per timestep, now covered by a test.
The ncWMS plugin is already deployed (gs-ncwms-2.19-SNAPSHOT.jar) and its
GetTimeSeries operation returns a whole time series at a point in one
request. It was unusable because geosync creates mosaic coverages with no
band metadata, so the operation failed with "available property names are"
and an empty list. GeoServer does not fill the bands in itself here because
the store is created with configure=none.

Measured on geoserver-dev against hrrr ws, 49 timesteps:

  GetTimeSeries        1 request    153 ms   1534 bytes
  GetFeatureInfo x49   49 requests  675 ms

Values agree at every timestep. This also closes the "Dimensions tab throws
errors" item in the FIXME directly below.

Callers must pass PROPERTYNAME=GRAY_INDEX: NcWmsService.java:179 on 2.19
calls getPropertyNames().get(0) before checking size, so omitting it throws
IndexOutOfBoundsException rather than defaulting to the first band.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant