[Geoserver-users] image mosaic with GeoServerRESTPublisher

I got the imagemosaic to work if I didn’t include the indexer.properties and datastore.properties files and only had the geoTiffs. I can render the layer in the layer preview, and see it in the get capabilities document. The problem is the necessary Time dimension is not included in the get capabilities document, and I cant enable it in the geoserver console. I’m assuming that’s because I didn’t include the indexer.properties file.

All the documentation states that the ImageMosaic needs the indexer.properties file but why does geoserver 2.7 break when I include it?

My indexer.properties file:

TimeAttribute = validtime

Schema = *the_geom:Polygon,location:String,validtime:java.util.Date

PropertyCollectors = TimestampFileNameExtractorSPItimeregex

After the Imagemosaic is complete I see the .properties file created from GeoTools.

#-Automagically created from GeoTools-

#Fri Jun 12 21:56:26 UTC 2015

Levels=0.21573153409091006,0.21573153409091006

Heterogeneous=false

AbsolutePath=false

Name=ThresholdID-133

TypeName=ThresholdID-133

Caching=false

ExpandToRGB=false

LocationAttribute=location

SuggestedSPI=it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi

CheckAuxiliaryMetadata=false

LevelsNum=1

···

Thanks for your help

Dom

From: Bessette-Halsema, Dominique E
Sent: Thursday, June 11, 2015 5:47 PM
To: geoserver-users@lists.sourceforge.net
Subject: image mosaic with GeoServerRESTPublisher

Is the image mosaic the best way to add TIME and ELEVATION dimensions to a layer in geoserver?

If so, I’m having an issues creating an image mosaic with the GeoServerRESTPublisher API in GeoServer 2.7.

I create several geotiffs to a file directory within the GEOSERVER_DATA_DIR/data/. with the name structure ID_TIME.tiff (133_2015-06-11T03.tif)

I then create the indexer, timeregex and datastore properties files.

Using the GeoServerRESTPublisher I try to post the mosaic to geoserver publishExternalMosaic(workspace, storename, new File(path), coverageEnc, encoder)

It creates the ImageMosaic Store but fails when it creates the layer

I get the following error:

00:19:40,009 INFO [org.geoserver.catalog.rest] (http-/0.0.0.0:8080-2) Using existing coverage store: COA_ID_1.RULE_ID_5.THRESHOLD_ID_133

ERROR 4: `/gis/geoserver/external/data/dynamic/missionthresholding/THRESHOLDING_MISSION_ID_1/COA_ID_1/RULE_ID_5/THRESHOLD_ID_133/indexer.properties’ not recognised as a supported file format.

ERROR 4: `/gis/geoserver/external/data/dynamic/missionthresholding/THRESHOLDING_MISSION_ID_1/COA_ID_1/RULE_ID_5/THRESHOLD_ID_133/indexer.properties’ not recognised as a supported file format.

00:19:40,063 ERROR [class org.geotools.gce.imagemosaic.Utils] (http-/0.0.0.0:8080-2) For input string: “E”: java.lang.NumberFormatException: For input string: “E”

at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1250) [rt.jar:1.7.0_72]

at java.lang.Double.parseDouble(Double.java:540) [rt.jar:1.7.0_72]

at it.geosolutions.imageio.utilities.StringToDouble.compute(StringToDouble.java:272) [imageio-ext-utilities-1.1.10.jar:]

at it.geosolutions.imageio.plugins.arcgrid.raster.AsciiGridRaster.getValue(AsciiGridRaster.java:1154) [imageio-ext-arcgrid-1.1.10.jar:]

at it.geosolutions.imageio.plugins.arcgrid.raster.EsriAsciiGridRaster.parseHeader(EsriAsciiGridRaster.java:161) [imageio-ext-arcgrid-1.1.10.jar:]

at it.geosolutions.imageio.plugins.arcgrid.spi.AsciiGridsImageReaderSpi.canDecodeInput(AsciiGridsImageReaderSpi.java:217) [imageio-ext-arcgrid-1.1.10.jar:]

…….

00:29:08,039 WARN [org.geotools.gce.imagemosaic] (http-/0.0.0.0:8080-2) Failure occurred while collecting the granules: org.apache.commons.io.DirectoryWalker$CancelException: Operation Cancelled

at org.apache.commons.io.DirectoryWalker.checkIfCancelled(DirectoryWalker.java:395) [commons-io-2.1.jar:2.1]

at org.apache.commons.io.DirectoryWalker.walk(DirectoryWalker.java:368) [commons-io-2.1.jar:2.1]

at org.apache.commons.io.DirectoryWalker.walk(DirectoryWalker.java:335) [commons-io-2.1.jar:2.1]

at org.geotools.gce.imagemosaic.ImageMosaicDirectoryWalker$MosaicDirectoryWalker.(ImageMosaicDirectoryWalker.java:114) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.ImageMosaicDirectoryWalker.run(ImageMosaicDirectoryWalker.java:196) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.Utils.createMosaic(Utils.java:354) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.Utils.checkSource(Utils.java:1223) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.ImageMosaicReader.initReaderFromURL(ImageMosaicReader.java:516) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.ImageMosaicReader.(ImageMosaicReader.java:468) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.ImageMosaicFormat.getReader(ImageMosaicFormat.java:483) [gt-imagemosaic-13.1.jar:]

at org.geotools.gce.imagemosaic.ImageMosaicFormat.getReader(ImageMosaicFormat.java:103) [gt-imagemosaic-13.1.jar:

more INFO:

MOSAIC_DATA_DIR contents:

133_2015-06-11T00.asc

133_2015-06-11T01.asc

133_2015-06-11T02.asc

133_2015-06-11T03.asc

133_2015-06-11T00.tif

133_2015-06-11T01.tif

133_2015-06-11T02.tif

133_2015-06-11T03.tif

indexer.properties

datastore.properties

timeregex.properties

datastore.properties

schema = geoimpact

preparedStatements = true

SPI = org.geotools.data.postgis.PostgisNGJNDIDataStoreFactory

jndiReferenceName = java:jboss/datasources/gisDB

indexer.properties:

TimeAttribute = validtime

AdditionalDomainAttributes = analysis_time

Schema = *the_geom:Polygon,location:String,validtime:java.util.Date,analysis_time:java.util.Date

PropertyCollectors = TimestampFileNameExtractorSPItimeregex,TimestampFileNameExtractorSPItimeregex

Timeregex.properties

regex = [0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}

Thanks for you help

Dom