Examples of GeoKeyEntry


Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

      return (GeoKeyEntry) (it);
    return null;
  }

  public GeoKeyEntry getGeoKeyEntry(int keyID) {
    GeoKeyEntry retVal = null;
    final Object o = geoTiffEntries.first(Integer.valueOf(keyID));
    if (o != null)
      retVal = (GeoKeyEntry) o;

    return retVal;
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

  public boolean hasGeoKeyEntry(int keyID) {
    return getGeoKeyEntry(keyID) != null;
  }

  public int getGeoShortParam(int keyID) {
    final GeoKeyEntry entry = getNonNullKeyEntry(keyID);
    final int tag = entry.getTiffTagLocation();
    final int value = entry.getValueOffset();
    checkParamTag(tag, 0);

    return value;
  }
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

    return value;
  }

  public double getGeoDoubleParam(int keyID) {
    final GeoKeyEntry entry = getNonNullKeyEntry(keyID);
    final int tag = entry.getTiffTagLocation();
    final int offset = entry.getValueOffset();
    checkParamTag(tag, getGeoDoubleParamsTag().getNumber());

    return geoTiffDoubleParams[offset];
  }
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

  public double[] getGeoDoubleParams(int keyID) {
    return getGeoDoubleParams(keyID, null);
  }

  public double[] getGeoDoubleParams(int keyID, double[] values) {
    final GeoKeyEntry entry = getNonNullKeyEntry(keyID);
    final int tag = entry.getTiffTagLocation();
    final int count = entry.getCount();
    final int offset = entry.getValueOffset();
    checkParamTag(tag, getGeoDoubleParamsTag().getNumber());

    if (values == null) {
      values = new double[count];
    }
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

    return values;
  }

  public String getGeoAsciiParam(int keyID) {
    final GeoKeyEntry entry = getNonNullKeyEntry(keyID);
    final int tag = entry.getTiffTagLocation();
    final int count = entry.getCount();
    final int offset = entry.getValueOffset();
    checkParamTag(tag, getGeoAsciiParamsTag().getNumber());

    return geoTiffAsciiParams.substring(offset, (offset + count) - 1);
  }
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

    if (!isTiffUShort(offset)) {
      throw new IllegalArgumentException("offset is not a TIFF USHORT");
    }

    final int numKeyEntries = numGeoTiffEntries;
    geoTiffEntries.add(Integer.valueOf(keyID), new GeoKeyEntry(keyID, tag,
        count, offset));
    getGeoKeyEntryAt(0).setCount(numKeyEntries);
    numGeoTiffEntries++;
  }
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

  protected static TIFFTag getNoDataTag() {
          return GeoTiffConstants.NODATA_TAG;
        }

  private GeoKeyEntry getNonNullKeyEntry(int keyID) {
    final GeoKeyEntry entry = getGeoKeyEntry(keyID);

    if (entry == null) {
      throw new IllegalArgumentException(
          "Unable to find an entry for the provided geo key " + keyID);
    }
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

        geoKeys = new HashMap<Integer, GeoKeyEntry>();
        if (geoKeyDir != null) {
            NodeList geoKeyDirEntries = geoKeyDir.getFirstChild().getChildNodes();
            for (int i = 4; i < geoKeyDirEntries.getLength(); i += 4) {
                int keyID = GeoTiffMetadataUtilities.getIntValueAttribute(geoKeyDirEntries.item(i));
                GeoKeyEntry key = new GeoKeyEntry(keyID,// key
                        GeoTiffMetadataUtilities.getIntValueAttribute(geoKeyDirEntries.item(i + 1)),// location
                        GeoTiffMetadataUtilities.getIntValueAttribute(geoKeyDirEntries.item(i + 2)),// count
                        GeoTiffMetadataUtilities.getIntValueAttribute(geoKeyDirEntries.item(i + 3)));// offset

                if (!geoKeys.containsKey(keyID)) {
View Full Code Here

Examples of org.geotools.coverage.grid.io.imageio.geotiff.GeoKeyEntry

     *
     * @return A string representing the value, or null if the key was not found.
     */
    public String getGeoKey(final int keyID) {

        final GeoKeyEntry rec = getGeoKeyRecord(keyID);
        if (rec == null) {
            return null;
        }
        if (rec.getTiffTagLocation() == 0) {
            // value is stored directly in the GeoKey record
            return String.valueOf(rec.getValueOffset());
        }

        // value is stored externally
        // get the TIFF field where the data is actually stored
        final IIOMetadataNode field = GeoTiffMetadataUtilities.getTiffField(rootNode, rec.getTiffTagLocation());
        if (field == null) {
            return null;
        }

        final Node sequence = field.getFirstChild();
        if (sequence == null) {
            return null;
        }

        return sequence.getNodeName().equals(GeoTiffConstants.GEOTIFF_ASCIIS_TAG) ? GeoTiffMetadataUtilities.getTiffAscii(
                (IIOMetadataNode) sequence, rec.getValueOffset(), rec.getCount())
                : GeoTiffMetadataUtilities.getValueAttribute(sequence.getChildNodes().item(rec.getValueOffset()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.