Search in sources :

Example 1 with GeoWavePluginException

use of mil.nga.giat.geowave.adapter.vector.plugin.GeoWavePluginException in project incubator-rya by apache.

the class GeoWaveGeoIndexer method initInternal.

private void initInternal() throws IOException {
    validPredicates = ConfigUtils.getGeoPredicates(conf);
    try {
        geoToolsDataStore = createDataStore(conf);
        geoWaveDataStore = ((GeoWaveGTDataStore) geoToolsDataStore).getDataStore();
    } catch (final GeoWavePluginException e) {
        logger.error("Failed to create GeoWave data store", e);
    }
    try {
        featureType = getStatementFeatureType(geoToolsDataStore);
    } catch (final IOException | SchemaException e) {
        throw new IOException(e);
    }
    featureDataAdapter = new FeatureDataAdapter(featureType);
    featureSource = geoToolsDataStore.getFeatureSource(featureType.getName());
    if (!(featureSource instanceof FeatureStore)) {
        throw new IllegalStateException("Could not retrieve feature store");
    }
    featureStore = (FeatureStore<SimpleFeatureType, SimpleFeature>) featureSource;
}
Also used : SchemaException(org.geotools.feature.SchemaException) SimpleFeatureType(org.opengis.feature.simple.SimpleFeatureType) IOException(java.io.IOException) FeatureDataAdapter(mil.nga.giat.geowave.adapter.vector.FeatureDataAdapter) FeatureStore(org.geotools.data.FeatureStore) SimpleFeature(org.opengis.feature.simple.SimpleFeature) GeoWavePluginException(mil.nga.giat.geowave.adapter.vector.plugin.GeoWavePluginException)

Aggregations

IOException (java.io.IOException)1 FeatureDataAdapter (mil.nga.giat.geowave.adapter.vector.FeatureDataAdapter)1 GeoWavePluginException (mil.nga.giat.geowave.adapter.vector.plugin.GeoWavePluginException)1 FeatureStore (org.geotools.data.FeatureStore)1 SchemaException (org.geotools.feature.SchemaException)1 SimpleFeature (org.opengis.feature.simple.SimpleFeature)1 SimpleFeatureType (org.opengis.feature.simple.SimpleFeatureType)1