use of org.locationtech.geowave.format.geotools.vector.GeoToolsVectorDataStoreIngestFormat in project geowave by locationtech.
the class GeoWaveSpatialBinningAggregationIT method testIngestThenBinnedQuery.
@Test
public void testIngestThenBinnedQuery() {
final IngestOptions.Builder<SimpleFeature> builder = IngestOptions.newBuilder();
final DataStore dataStore = dataStoreOptions.createDataStore();
dataStore.ingest(HAIL_SHAPEFILE_FILE, builder.threads(4).format(new GeoToolsVectorDataStoreIngestFormat().createLocalFileIngestPlugin(new GeoToolsVectorDataOptions())).build(), TestUtils.DimensionalityType.SPATIAL_TEMPORAL.getDefaultIndices());
try {
for (final SpatialBinningType type : SpatialBinningType.values()) {
for (int precision = 1; precision < 7; precision++) {
testBinnedAggregation(type, precision, new File(TEST_POLYGON_TEMPORAL_FILTER_FILE).toURI().toURL(), TestUtils.DEFAULT_SPATIAL_TEMPORAL_INDEX, dataStore);
}
}
} catch (final Exception e) {
e.printStackTrace();
TestUtils.deleteAll(dataStoreOptions);
Assert.fail("Error occurred while testing a polygon and time range query of spatial temporal index: '" + e.getLocalizedMessage() + '\'');
}
TestUtils.deleteAll(dataStoreOptions);
}
use of org.locationtech.geowave.format.geotools.vector.GeoToolsVectorDataStoreIngestFormat in project geowave by locationtech.
the class GeoWaveBasicSpatialTemporalVectorIT method testIngestAndQuerySpatialTemporalPointsAndLines.
@Test
public void testIngestAndQuerySpatialTemporalPointsAndLines() {
// ingest both lines and points
final IngestOptions.Builder<SimpleFeature> builder = IngestOptions.newBuilder();
dataStore.createDataStore().ingest(HAIL_SHAPEFILE_FILE, builder.threads(NUM_THREADS).format(new GeoToolsVectorDataStoreIngestFormat().createLocalFileIngestPlugin(new GeoToolsVectorDataOptions())).build(), DimensionalityType.SPATIAL_TEMPORAL.getDefaultIndices());
if (!POINTS_ONLY) {
dataStore.createDataStore().ingest(TORNADO_TRACKS_SHAPEFILE_FILE, IngestOptions.newBuilder().threads(NUM_THREADS).build(), DimensionalityType.SPATIAL_TEMPORAL.getDefaultIndices());
}
try {
URL[] expectedResultsUrls;
if (POINTS_ONLY) {
expectedResultsUrls = new URL[] { new File(HAIL_EXPECTED_BOX_TEMPORAL_FILTER_RESULTS_FILE).toURI().toURL() };
} else {
expectedResultsUrls = new URL[] { new File(HAIL_EXPECTED_BOX_TEMPORAL_FILTER_RESULTS_FILE).toURI().toURL(), new File(TORNADO_TRACKS_EXPECTED_BOX_TEMPORAL_FILTER_RESULTS_FILE).toURI().toURL() };
}
testQuery(new File(TEST_BOX_TEMPORAL_FILTER_FILE).toURI().toURL(), expectedResultsUrls, "bounding box and time range");
} catch (final Exception e) {
e.printStackTrace();
TestUtils.deleteAll(dataStore);
Assert.fail("Error occurred while testing a bounding box and time range query of spatial temporal index: '" + e.getLocalizedMessage() + "'");
}
try {
URL[] expectedResultsUrls;
if (POINTS_ONLY) {
expectedResultsUrls = new URL[] { new File(HAIL_EXPECTED_POLYGON_TEMPORAL_FILTER_RESULTS_FILE).toURI().toURL() };
} else {
expectedResultsUrls = new URL[] { new File(HAIL_EXPECTED_POLYGON_TEMPORAL_FILTER_RESULTS_FILE).toURI().toURL(), new File(TORNADO_TRACKS_EXPECTED_POLYGON_TEMPORAL_FILTER_RESULTS_FILE).toURI().toURL() };
}
testQuery(new File(TEST_POLYGON_TEMPORAL_FILTER_FILE).toURI().toURL(), expectedResultsUrls, "polygon constraint and time range");
} catch (final Exception e) {
e.printStackTrace();
TestUtils.deleteAll(dataStore);
Assert.fail("Error occurred while testing a polygon and time range query of spatial temporal index: '" + e.getLocalizedMessage() + "'");
}
try {
URL[] statsInputs;
if (POINTS_ONLY) {
statsInputs = new URL[] { new File(HAIL_SHAPEFILE_FILE).toURI().toURL() };
} else {
statsInputs = new URL[] { new File(HAIL_SHAPEFILE_FILE).toURI().toURL(), new File(TORNADO_TRACKS_SHAPEFILE_FILE).toURI().toURL() };
}
testStats(statsInputs, (NUM_THREADS > 1), TestUtils.DEFAULT_SPATIAL_TEMPORAL_INDEX);
} catch (final Exception e) {
e.printStackTrace();
TestUtils.deleteAll(dataStore);
Assert.fail("Error occurred while testing a bounding box stats on spatial temporal index: '" + e.getLocalizedMessage() + "'");
}
try {
for (int i = 0; i < 5; i++) {
testSpatialTemporalLocalExportAndReingestWithCQL(new File(TEST_BOX_TEMPORAL_FILTER_FILE).toURI().toURL(), NUM_THREADS, POINTS_ONLY, DimensionalityType.SPATIAL_TEMPORAL);
}
} catch (final Exception e) {
e.printStackTrace();
TestUtils.deleteAll(dataStore);
Assert.fail("Error occurred while testing deletion of an entry using spatial index: '" + e.getLocalizedMessage() + "'");
}
try {
testDeleteDataId(new File(TEST_BOX_TEMPORAL_FILTER_FILE).toURI().toURL(), TestUtils.DEFAULT_SPATIAL_TEMPORAL_INDEX);
} catch (final Exception e) {
e.printStackTrace();
TestUtils.deleteAll(dataStore);
Assert.fail("Error occurred while testing deletion of an entry using spatial temporal index: '" + e.getLocalizedMessage() + "'");
}
TestUtils.deleteAll(dataStore);
}
Aggregations