1

I'm trying to build mosaics from NetCDF files using the indexer.xml file instead of the *.properties files so we can take advantage of the NetCDF auxiliary file. (Using GeoServer 2.14.2 btw)

My typical filenames look like: filename_201903031503.nc

And using the old properties files my timeregex.properties is:

regex=[0-9]{12},format=yyyyMMddhhmm

However I can't figure out how to pass the format parameter when using the indexer.xml file, I started with the following collector configuration:

<collectors>
  <collector name="timeFrameCollector">
    <value>format=yyyyMMddHHmm,regex=[0-9]{12}</value>
    <spi>TimestampFileNameExtractorSPI</spi>
    <mapped>time</mapped>
  </collector>
</collectors>

As suggested on the following page: http://osgeo-org.1560.x6.nabble.com/ImageMosaic-indexer-xml-time-domain-custom-dimensions-td5144486.html

Unfortunately that gives me a Failed to create reader from file:data/supplier/product error.

As a temporary solution I can rename the files to this: filename_20190303T150300Z.nc

Then the following XML works:

<collectors>
  <collector name="timeFrameCollector">
    <value>[0-9]{8}T[0-9]{6}Z</value>
    <spi>TimestampFileNameExtractorSPI</spi>
    <mapped>time</mapped>
  </collector>
</collectors>

I'd really like to avoid renaming the files, they are supplied to us and I'd prefer to do zero/minimal processing. Is there a way to pass the date/time format to the collector using the indexer.xml file?

  • can you turn logging up to GeoTools debug and run the first one again - you should see a better error message in the log then – Ian Turton Mar 7 at 8:54
  • @IanTurton resolved the issue, the string for value has to be regex=[0-9]{12},format=yyyyMMddhhmm not format=yyyyMMddhhmm,regex=[0-9]{12}.Thanks for suggestion on turning the logging level up, resolved this issue and another related to recreating ImageMosaics that already have a schema in the index database. – AEgman Mar 8 at 9:58
  • Please add that as an answer for future readers – Ian Turton Mar 8 at 10:12
1

As Ian Turon suggested in his comment, turning on a higher level of logging identified the issue.

In this case the string used in the value parameter must be regex=[0-9]{12},format=yyyyMMddhhmm not format=yyyyMMddhhmm,regex=[0-9]{12} as shown in the example here.

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.