Monday, 9 February 2015

geoserver - Imagemosaic with CoverageNameCollector


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



Answer



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])

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