Package mil.nga.giat.geowave.index

Examples of mil.nga.giat.geowave.index.ByteArrayId


                this))));
    final AdapterPersistenceEncoding encoding;
    if (entry instanceof FitToIndexGridCoverage) {
      encoding = new FitToIndexPersistenceEncoding(
          getAdapterId(),
          new ByteArrayId(
              new byte[] {}),
          new PersistentDataset<CommonIndexValue>(),
          adapterExtendedData,
          ((FitToIndexGridCoverage) entry).getIndexId());
    }
    else {
      // this shouldn't happen
      LOGGER.warn("Grid coverage is not fit to the index");
      encoding = new AdapterPersistenceEncoding(
          getAdapterId(),
          new ByteArrayId(
              new byte[] {}),
          new PersistentDataset<CommonIndexValue>(),
          adapterExtendedData);
    }
    return encoding;
View Full Code Here


  @Override
  public DataStatistics<GridCoverage> createDataStatistics(
      final ByteArrayId statisticsId ) {
    if (OverviewStatistics.STATS_ID.equals(statisticsId)) {
      return new OverviewStatistics(
          new ByteArrayId(
              coverageName));
    }
    else if (BoundingBoxDataStatistics.STATS_ID.equals(statisticsId)) {
      return new RasterBoundingBoxStatistics(
          new ByteArrayId(
              coverageName));
    }
    else if (RasterFootprintStatistics.STATS_ID.equals(statisticsId)) {
      return new RasterBoundingBoxStatistics(
          new ByteArrayId(
              coverageName));
    }
    else if (HistogramStatistics.STATS_ID.equals(statisticsId) && (histogramConfig != null)) {
      return new HistogramStatistics(
          new ByteArrayId(
              coverageName),
          histogramConfig);
    }
    return null;
  }
View Full Code Here

            new DimensionField[] {}));
  }

  @Override
  public ByteArrayId getId() {
    return new ByteArrayId(
        StringUtils.stringToBinary(indexStrategy.getId()));
  }
View Full Code Here

      final byte[] bytes ) {
    final ByteBuffer buf = ByteBuffer.wrap(bytes);
    final int fieldIdLength = buf.getInt();
    final byte[] fieldIdBinary = new byte[fieldIdLength];
    buf.get(fieldIdBinary);
    fieldId = new ByteArrayId(
        fieldIdBinary);

    final byte[] dimensionBinary = new byte[bytes.length - fieldIdLength - 4];
    buf.get(dimensionBinary);
    baseDefinition = PersistenceUtils.fromBinary(
View Full Code Here

    if (expectedByteCount <= 0) {
      // special case for no precision
      return new RangeDecomposition(
          new ByteArrayRange[] {
            new ByteArrayRange(
                new ByteArrayId(
                    new byte[] {}),
                new ByteArrayId(
                    new byte[] {}))
          });
    }
    for (int i = 0; i < hilbertRanges.size(); i++) {
      final FilteredIndexRange<LongRange, LongRange> range = hilbertRanges.get(i);
      // sanity check that values fit within the expected range
      // it seems that uzaygezen can produce a value at 2^totalPrecision
      // rather than 2^totalPrecision - 1
      final long startValue = clamp(
          minHilbertValue,
          maxHilbertValue,
          range.getIndexRange().getStart());
      final long endValue = clamp(
          minHilbertValue,
          maxHilbertValue,
          range.getIndexRange().getEnd() - 1);
      // make sure its padded if necessary
      final byte[] start = HilbertSFC.fitExpectedByteCount(
          expectedByteCount,
          ByteBuffer.allocate(
              8).putLong(
              startValue).array());

      // make sure its padded if necessary
      final byte[] end = HilbertSFC.fitExpectedByteCount(
          expectedByteCount,
          ByteBuffer.allocate(
              8).putLong(
              endValue).array());
      sfcRanges[i] = new ByteArrayRange(
          new ByteArrayId(
              start),
          new ByteArrayId(
              end));
    }

    final RangeDecomposition rangeDecomposition = new RangeDecomposition(
        sfcRanges);
View Full Code Here

          return insertionIds.hasNext();
        }

        @Override
        public GridCoverage next() {
          final ByteArrayId insertionId = insertionIds.next();
          if (insertionId == null) {
            return null;
          }
          final MultiDimensionalNumericData rangePerDimension = pyramidLevel.getIndexStrategy().getRangeForId(
              insertionId);
View Full Code Here

      final byte[] bytes ) {
    final ByteBuffer buf = ByteBuffer.wrap(bytes);
    final int fieldIdLength = buf.getInt();
    final byte[] fieldIdBinary = new byte[fieldIdLength];
    buf.get(fieldIdBinary);
    fieldId = new ByteArrayId(
        fieldIdBinary);

    final byte[] dimensionBinary = new byte[bytes.length - fieldIdLength - 4];
    buf.get(dimensionBinary);
    baseDefinition = PersistenceUtils.fromBinary(
View Full Code Here

  }

  protected ByteArrayId getSecondaryId(
      final Key key ) {
    if (key.getColumnQualifier() != null) {
      return new ByteArrayId(
          key.getColumnQualifier().getBytes());
    }
    return null;
  }
View Full Code Here

  }

  protected ByteArrayId getPrimaryId(
      final Key key ) {
    if (key.getRow() != null) {
      return new ByteArrayId(
          key.getRow().getBytes());
    }
    return null;
  }
View Full Code Here

    geometryFieldIds = new HashSet<ByteArrayId>(
        fieldIdSize);
    for (int i = 0; i < fieldIdSize; i++) {
      final byte[] fieldId = new byte[buf.getInt()];
      buf.get(fieldId);
      geometryFieldIds.add(new ByteArrayId(
          fieldId));
    }
    buf.get(theRest);
    queryGeometry = GeometryUtils.geometryFromBinary(geometryBinary);
View Full Code Here

TOP

Related Classes of mil.nga.giat.geowave.index.ByteArrayId

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.