Search in sources :

Example 1 with FitToIndexPersistenceEncoding

use of org.locationtech.geowave.core.store.adapter.FitToIndexPersistenceEncoding in project geowave by locationtech.

the class InternalRasterDataAdapter method encode.

@Override
public AdapterPersistenceEncoding encode(final GridCoverage entry, final AdapterToIndexMapping indexMapping, final Index index) {
    final PersistentDataset<Object> adapterExtendedData = new SingleFieldPersistentDataset<>();
    adapterExtendedData.addValue(RasterDataAdapter.DATA_FIELD_ID, ((RasterDataAdapter) adapter).getRasterTileFromCoverage(entry));
    final AdapterPersistenceEncoding encoding;
    if (entry instanceof FitToIndexGridCoverage) {
        encoding = new FitToIndexPersistenceEncoding(getAdapterId(), new byte[0], new MultiFieldPersistentDataset<>(), adapterExtendedData, ((FitToIndexGridCoverage) entry).getPartitionKey(), ((FitToIndexGridCoverage) entry).getSortKey());
    } else {
        // this shouldn't happen
        LOGGER.warn("Grid coverage is not fit to the index");
        encoding = new AdapterPersistenceEncoding(getAdapterId(), new byte[0], new MultiFieldPersistentDataset<>(), adapterExtendedData);
    }
    return encoding;
}
Also used : FitToIndexGridCoverage(org.locationtech.geowave.adapter.raster.FitToIndexGridCoverage) MultiFieldPersistentDataset(org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset) AdapterPersistenceEncoding(org.locationtech.geowave.core.store.adapter.AdapterPersistenceEncoding) IndexedAdapterPersistenceEncoding(org.locationtech.geowave.core.store.adapter.IndexedAdapterPersistenceEncoding) FitToIndexPersistenceEncoding(org.locationtech.geowave.core.store.adapter.FitToIndexPersistenceEncoding) SingleFieldPersistentDataset(org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset)

Aggregations

FitToIndexGridCoverage (org.locationtech.geowave.adapter.raster.FitToIndexGridCoverage)1 AdapterPersistenceEncoding (org.locationtech.geowave.core.store.adapter.AdapterPersistenceEncoding)1 FitToIndexPersistenceEncoding (org.locationtech.geowave.core.store.adapter.FitToIndexPersistenceEncoding)1 IndexedAdapterPersistenceEncoding (org.locationtech.geowave.core.store.adapter.IndexedAdapterPersistenceEncoding)1 MultiFieldPersistentDataset (org.locationtech.geowave.core.store.data.MultiFieldPersistentDataset)1 SingleFieldPersistentDataset (org.locationtech.geowave.core.store.data.SingleFieldPersistentDataset)1