1

I'm trying to get an Imagemosaic of Sentinel2 data with one coverage for each band to work.

As described in the docs, I want to make use of the CoverageNameCollector property. But the docs are very vague about it and I cannot get it to work. I always end up with just one Coverage.

Beisdes the official docs, I did not find any other source for documentation or tutorial.

My indexer.properties file looks like this:

GranuleAcceptors=org.geotools.gce.imagemosaic.acceptors.HeterogeneousCRSAcceptorFactory
GranuleHandler=org.geotools.gce.imagemosaic.granulehandler.ReprojectingGranuleHandlerFactory
HeterogeneousCRS=true
MosaicCRS=EPSG\:4326
TimeAttribute=time
PropertyCollectors=TimestampFileNameExtractorSPI[timeregex](time),CRSExtractorSPI(crs)
CoverageNameCollector=org.geotools.gce.imagemosaic.namecollector.FileNameRegexNameCollectorSPI:regex=(B[0-1][0-9]).jp2$
Schema=*the_geom:Polygon,location:String,time:java.util.Date,crs:String
CanBeEmpty=true

Example Filename: T60VXJ_20170421T232711_B03.jp2

I use current development snapshot of GeoServer (2.12).

1
  • please edit your question to give us examples of the file names used, and what is in the log file (on Developer-DEBUG) when you try to create the mosaic
    – Ian Turton
    May 23 '17 at 12:54
2

I made it working, there were two issues with my indexer.properties:

  1. The name of the Property is CoverageNameCollectorSPI instead of CoverageNameCollector. It was a typo in the docs, but got updated (thanks @Daniele Romagnoli)

  2. FileNameRegexCollector uses the BaseName of the file so the extension is not part of the parsing.


Working solution:

CoverageNameCollectorSPI=org.geotools.gce.imagemosaic.namecollector.FileNameRegexNameCollectorSPI:regex=_(B[018][0-9A])

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.