4

I have Time Dimension Working with an Image Mosaic layer. Is it possible to add dimensions other than time/elevation? For example the files in my mosaic are named as follows where rtma or pris represents a "climate" attribute:

pristmax_20150115.tif
pristmax_20150115.tif
rtmatmax_20150116.tif
rtmatmax_20150116.tif

In my mosaic directory, I now have two regex property files (one for time dimension and one for climatesource dimension):

timeregex.properties containing regex=[0-9]{8}
climateregex.properties containing regex=^.{4}

I modified my indexer.properties property file look like so:

TimeAttribute=ingestion
ClimateAttribute=climatesource
Schema=*the_geom:Polygon,location:String,ingestion:java.util.Date,climatesource:String
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](ingestion),StringFileNameExtractorSPI[climateregex](climatesource)

I also tried modifying postgis_rasters.properties to have a ClimateAttribute:

#-Automagically created from GeoTools-
#Wed Nov 25 13:16:00 MST 2015
Levels=0.026578191679850746,0.026578191679850746
Heterogeneous=false
TimeAttribute=ingestion
ClimateAttribute=climatesource
AbsolutePath=false
Name=postgis_rasters
TypeName=postgis_rasters
Caching=false
ExpandToRGB=false
LocationAttribute=location
SuggestedSPI=it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi
CheckAuxiliaryMetadata=false
LevelsNum=1

Geoserver created a table in Postgis as expected:

1 | 0103... |   rtmatmax_20150115.tif | 2015-01-14 17:00:00.000000 |    rtma

2 | 0103... |   pristmax_20150115.tif | 2015-01-14 17:00:00.000000 |    pris

But using &climate=rtma or &climate=pris in my url doesn't effect which raster is retrieved, whereas &time=2015-01-14 or &time=2015-01-15 selects the raster from that day. How can I get the climate attribute to function?

--- UPDATE ---

After following @rovo's answer, the new dimension appears in geoserver. Here is a screen cap.enter image description here

And here is an example the postres side (note my regex was wrong so I currently don't have what I meant to have under climatesource but this is just a test): enter image description here

The part I'm not yet able to get working is geoserver seems to be ignoring the CLIMATESOURCE param in my url.

In the getcapabilities I see

<Dimension name="time" units="ISO8601"/>
<Dimension name="CLIMATESOURCE" units=""/>
<Extent name="time" default="2017-07-06T00:00:00Z">2016-01-01T00:00:00.000Z,2016-01-02T00:00:00.000Z...
<Extent name="CLIMATESOURCE" default="agdd_20170706_base_thirtytwo">agdd_20160101_base_fifty,agdd_20160101_base_thirtytwo.....

When using &time=2017-07-06&CLIMATESOURCE=agdd_20170206_base_thirtytwo I get a valid map back because 2017-07-07 happens to match the default for CLIMATESOURCE. When I change time to be anything else it doesn't return a map because it's still using the default "agdd_20170706_base_thirtytwo" even if I try overriding CLIMATESOURCE with a matching date.

--- UPDATE2 SOLVED ---

RoVo's answer now clarifies to use DIM_CLIMATESOURCE in the WMS request.

  • can you see what is in the log file (with logging set to debug), the only thing I can suggest is adding " around the rtma and pris in the filter to make sure GeoServer sees them as strings – Ian Turton Nov 26 '15 at 9:18
1

ClimateAttribute is an unknown keyword and will be ignored when the indexer.properties is read. The correct keyword to add additional dimensions to an Imagemosaic is AdditionalDomainAttributes.

The following should work adding a new Dimension in the Dimensions tab:

indexer.properties

TimeAttribute=time
AdditionalDomainAttributes=climatesource(climatesource)
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](time),StringFileNameExtractorSPI[climateregex](climatesource)
Schema=*the_geom:Polygon,location:String,time:java.util.Date,climatesource:String

climateregex.properties

regex=^.{4}

Note: String and Date dimensions are working properly, but due to a bug, Integer or Double Values are read as String only. That makes it not possible yet to query intervals. See this Bug Report.

Update: The bug has been fixed in 2.11.2.

WMS Request:

 &DIM_CLIMATESOURCE=...
  • Thanks bud, I think your answer is correct. I updated the question with more progress and one last hurdle I'm still hitting where the CLIMATESOURCE param doesn't seem to be getting read from the url requests made to geoserver. Have any ideas why that is? – apricity Jun 30 '17 at 19:33
  • I updates the answer with the correct wms request – pLumo Jun 30 '17 at 20:19
  • It works! How did you know or where did you find to prefix the dimension with DIM_ ? – apricity Jun 30 '17 at 20:23
0

Ciao, a few questions plus some pointers.

  1. Have you configured the additional dimension in the Dimension tab for the GeoServer Layer?
  2. Have you checked that the GetCapabilities response correctly list the dimension you created
  3. Are you using the corrent name for the dimension when you make a request? According to WMS 1.1.1 for example if you create a dimension in GeoServer called XXXX you should make requests by appending &DIM_XXXX=XYZ

Some pointers:

Let us know how it goes.

Simone.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.