Skip to content

Commit

Permalink
Creating GranuleCollectorFactory
Browse files Browse the repository at this point in the history
Creating a GranuleCollectorFactory to abstract out creating granule
collectors, moving actual mosaic creation logic into granule collector,
eventually going to rename these classes to reflect their new
responsibilities. Had to make some inner classes static to accomplish
this.
Moving GranuleCollector to its own package + all the necessary modifier changes for that
Adding granule collector factory to raster layer response
Indexer is now initialized when ImageMosaic is initialized.
this was done so that we have access to its configuration while
reading the image mosaic.
A decent number of things shuffling around, in particular moving some
subclasses out of RasterLayerResponse to top level classes for clarity
(since these classes are now used outside of this class)
Added the correct test results image
Don't use default Operations object, instead create one with hints we may need.
Removed some unused code that was missed
Removed some unused imports
Fixed a test case with a fixed number and the size check in RasterLayerResponse to account for nulls in the list
Fixed an issue where indexer file wasn't getting initilized correctly

Reformatting the code in Eclipse

Renamed isHasAlpha and isDoTransparency to more sensible names

- Changed ReprojectingConfigHandler to properly respect sort order
- Relax requirement on property collectors in order to support collectors that don't need config
- Added some defaults to properties collectors and granulecollector when HETEROGENEOUS_CRS is true

- Rename coverageEnvelope to granuleEnvelope and make its access private

- Removing unused granuleCRS

- Rename old references to GranuleCollectors to SubmosaicProducers

- Move Mosaicker into its own compilation unit.

- Add another utility method to indexer utils for setting params on an Indexer
- Remove submosaic producer artifacts from GranuleCatalog and CatalogConfiguration bean, now moved to RasterManager

- Removed some debugging code that had been left in.

Simplified the sorting

Fixed a test that had been messed up by a mangled rebase
  • Loading branch information
Devon Tucker committed Aug 16, 2016
1 parent 12844ad commit 2068bd9
Show file tree
Hide file tree
Showing 60 changed files with 2,960 additions and 1,279 deletions.
Expand Up @@ -63,6 +63,7 @@
import org.geotools.data.DataUtilities;
import org.geotools.factory.Hints;
import org.geotools.factory.Hints.Key;
import org.geotools.geometry.GeneralEnvelope;
import org.geotools.geometry.jts.JTS;
import org.geotools.geometry.jts.ReferencedEnvelope;
import org.geotools.image.ImageWorker;
Expand Down Expand Up @@ -137,6 +138,16 @@ public class GranuleDescriptor {

OverviewsController overviewsController;

private GeneralEnvelope granuleEnvelope;

public GeneralEnvelope getGranuleEnvelope() {
return granuleEnvelope;
}

public void setGranuleEnvelope(GeneralEnvelope granuleEnvelope) {
this.granuleEnvelope = granuleEnvelope;
}

/**
* This class represent an overview level in a single granuleDescriptor.
*
Expand Down Expand Up @@ -228,7 +239,7 @@ public String toString() {
* @author Daniele Romagnoli, GeoSolutions S.A.S.
*
*/
static class GranuleLoadingResult {
public static class GranuleLoadingResult {

RenderedImage loadedImage;

Expand Down Expand Up @@ -294,7 +305,7 @@ public boolean isDoFiltering() {

ImageReaderSpi cachedReaderSPI;

SimpleFeature originator;
private SimpleFeature originator;

PAMDataset pamDataset;

Expand All @@ -309,7 +320,9 @@ public boolean isDoFiltering() {
/** {@link DatasetLayout} object containing information about granule internal structure */
private DatasetLayout layout;

/** {@link MaskOverviewProvider} used for handling external ROIs and Overviews */
/**
* {@link MaskOverviewProvider} used for handling external ROIs and Overviews
*/
private MaskOverviewProvider ovrProvider;

protected void init(final BoundingBox granuleBBOX, final URL granuleUrl,
Expand Down Expand Up @@ -340,6 +353,9 @@ protected void init(final BoundingBox granuleBBOX, final URL granuleUrl,
SpiHelper spiProvider = new SpiHelper(granuleFile, suggestedSPI);
boolean isMultidim = spiProvider.isMultidim();

GeneralEnvelope envelope = gcReader.getOriginalEnvelope();
this.granuleEnvelope = envelope;

ovrProvider = new MaskOverviewProvider(layout, granuleFile, spiProvider);

// get a stream
Expand Down Expand Up @@ -470,7 +486,7 @@ protected void init(final BoundingBox granuleBBOX, final URL granuleUrl,

/**
* Look for GDAL Auxiliary File and unmarshall it to setup a PamDataset if available
*
*
* @throws IOException
*/
private void checkPamDataset() throws IOException {
Expand Down Expand Up @@ -1254,5 +1270,4 @@ public Geometry getFootprint() {
return roiProvider.getFootprint();
}
}

}
Expand Up @@ -38,7 +38,7 @@
* @author Simone Giannecchini, GeoSolutions SAS
*
*/
class GranuleLoader implements Callable<GranuleLoadingResult> {
public class GranuleLoader implements Callable<GranuleLoadingResult> {

final ReferencedEnvelope cropBBox;

Expand All @@ -54,7 +54,7 @@ class GranuleLoader implements Callable<GranuleLoadingResult> {

RasterLayerRequest request;

GranuleLoader(final ImageReadParam readParameters, final int imageIndex,
public GranuleLoader(final ImageReadParam readParameters, final int imageIndex,
final ReferencedEnvelope cropBBox, final MathTransform2D mosaicWorldToGrid,
final GranuleDescriptor granuleDescriptor, final RasterLayerRequest request,
final Hints hints) {
Expand Down

0 comments on commit 2068bd9

Please sign in to comment.