Wednesday 25 February 2015

geoserver - Are Dimensions/Attributes Other Than Time and Elevation Possible


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




2016-01-01T00:00:00.000Z,2016-01-02T00:00:00.000Z...
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.



Answer



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=...

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...