Package mil.nga.giat.geowave.store

Examples of mil.nga.giat.geowave.store.DataStore


  @Override
  protected void generateGrid(
      final BasicAccumuloOperations bao ) {

    // create our datastore object
    final DataStore geowaveDataStore = getGeowaveDataStore(bao);

    // In order to store data we need to determine the type of data store
    final SimpleFeatureType point = createPointFeatureType();

    // This a factory class that builds simple feature objects based on the
    // type passed
    final SimpleFeatureBuilder pointBuilder = new SimpleFeatureBuilder(
        point);

    // This is an adapter, that is needed to describe how to persist the
    // data type passed
    final FeatureDataAdapter adapter = createDataAdapter(point);

    // This describes how to index the data
    final Index index = createSpatialIndex();

    // features require a featureID - this should be unqiue as it's a
    // foreign key on the feature
    // (i.e. sending in a new feature with the same feature id will
    // overwrite the existing feature)
    int featureId = 0;

    final Thread ingestThread = new Thread(
        new Runnable() {
          @Override
          public void run() {
            geowaveDataStore.ingest(
                adapter,
                index,
                features);
          }
        },
View Full Code Here


  @Override
  protected void generateGrid(
      final BasicAccumuloOperations bao ) {

    // create our datastore object
    final DataStore geowaveDataStore = getGeowaveDataStore(bao);

    // In order to store data we need to determine the type of data store
    final SimpleFeatureType point = createPointFeatureType();

    // This a factory class that builds simple feature objects based on the
    // type passed
    final SimpleFeatureBuilder pointBuilder = new SimpleFeatureBuilder(
        point);

    // This is an adapter, that is needed to describe how to persist the
    // data type passed
    final FeatureDataAdapter adapter = createDataAdapter(point);

    // This describes how to index the data
    final Index index = createSpatialIndex();

    // features require a featureID - this should be unqiue as it's a
    // foreign key on the feature
    // (i.e. sending in a new feature with the same feature id will
    // overwrite the existing feature)
    int featureId = 0;

    // get a handle on a GeoWave index writer which wraps the Accumulo
    // BatchWriter, make sure to close it (here we use a try with resources
    // block to close it automatically)
    try (IndexWriter indexWriter = geowaveDataStore.createIndexWriter(index)) {
      // build a grid of points across the globe at each whole
      // lattitude/longitude intersection
      for (int longitude = -180; longitude <= 180; longitude++) {
        for (int latitude = -90; latitude <= 90; latitude++) {
          pointBuilder.set(
View Full Code Here

  protected void generateGrid(
      final BasicAccumuloOperations bao ) {

    // create our datastore object
    final DataStore geowaveDataStore = getGeowaveDataStore(bao);

    // In order to store data we need to determine the type of data store
    final SimpleFeatureType point = createPointFeatureType();

    // This a factory class that builds simple feature objects based on the
    // type passed
    final SimpleFeatureBuilder pointBuilder = new SimpleFeatureBuilder(
        point);

    // This is an adapter, that is needed to describe how to persist the
    // data type passed
    final FeatureDataAdapter adapter = createDataAdapter(point);

    // This describes how to index the data
    final Index index = createSpatialIndex();

    // features require a featureID - this should be unqiue as it's a
    // foreign key on the feature
    // (i.e. sending in a new feature with the same feature id will
    // overwrite the existing feature)
    int featureId = 0;

    // build a grid of points across the globe at each whole
    // lattitude/longitude intersection
    for (int longitude = -180; longitude <= 180; longitude++) {
      for (int latitude = -90; latitude <= 90; latitude++) {
        pointBuilder.set(
            "geometry",
            GeometryUtils.GEOMETRY_FACTORY.createPoint(new Coordinate(
                longitude,
                latitude)));
        pointBuilder.set(
            "TimeStamp",
            new Date());
        pointBuilder.set(
            "Latitude",
            latitude);
        pointBuilder.set(
            "Longitude",
            longitude);
        // Note since trajectoryID and comment are marked as nillable we
        // don't need to set them (they default ot null).

        final SimpleFeature sft = pointBuilder.buildFeature(String.valueOf(featureId));
        featureId++;

        // this loads the data to geowave
        // in practice you probably wouldn't do this in a tight loop -
        // but use a producer/consumer, mapreduce, or some other
        // pattern. But if it matters depends also on the amount of data
        // you are ingesting.
        // Note that the ingest method can take a feature, or an
        // interator on a collection of SimpleFeatures. The latter
        // is the preferred mechanism for non-trivial data sets.
        geowaveDataStore.ingest(
            adapter,
            index,
            sft);
      }
    }
View Full Code Here

    }
    if (localFileIngestPlugins.isEmpty()) {
      LOGGER.fatal("There were no local file ingest type plugin providers found");
      return;
    }
    final DataStore dataStore = new AccumuloDataStore(
        operations);
    try (IngestRunData runData = new IngestRunData(
        adapters,
        dataStore)) {
      processInput(
View Full Code Here

TOP

Related Classes of mil.nga.giat.geowave.store.DataStore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.