Examples of GeoTiffException


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

               
                //
                // we handle just projected and geographic crs
                //
                if (!(crs instanceof ProjectedCRS || crs instanceof GeographicCRS)){
                    throw new GeoTiffException(
                            null,
                            "The supplied grid coverage uses an unsupported crs! You are allowed to use only projected and geographic coordinate reference systems",
                            null);                 
                }
                   
View Full Code Here

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

          new CitationImpl("EPSG"))), pcrs.getConversionFromBase()
          .getMethod(), (GeographicCRS) pcrs.getBaseCRS(), pcrs
          .getConversionFromBase().getMathTransform(),
          createProjectedCS(linearUnit));
    } catch (FactoryException fe) {
      final IOException ex = new GeoTiffException(metadata, fe
          .getLocalizedMessage(), fe);
      throw ex;
    }
  }
View Full Code Here

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

              (GeodeticDatum) gcs.getDatum(),
              DefaultEllipsoidalCS.GEODETIC_2D
                  .usingUnit(angularUnit));
        }
      } catch (FactoryException fe) {
        final IOException ex = new GeoTiffException(metadata, fe
            .getLocalizedMessage(), fe);

        throw ex;
      }
    }
View Full Code Here

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

                        xform = ProjectiveTransform.create(metadata
                                    .getModelTransformation());

                    }
                } else
                    throw new GeoTiffException(metadata,
                                    "Unknown Raster to Model configuration.", null);

                return xform;
  }
View Full Code Here

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

      //
      // //
      parameters = createUserDefinedProjectionParameter(projectionName,
          metadata);
      if (parameters == null)
        throw new GeoTiffException(
            metadata,
            "GeoTiffMetadata2CRSAdapter::createUserDefinedPCS:Projection is not supported.",
            null);

    } else {
View Full Code Here

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

            props.put("name", (name != null) ? name
                : "User Defined GEOTIFF Prime Meridian");
            pm = datumObjFactory.createPrimeMeridian(props,
                pmNumeric, linearUnit);
          } catch (NumberFormatException nfe) {
            final IOException io = new GeoTiffException(metadata,
                "Invalid user-defined prime meridian spec.",
                nfe);

            throw io;
          }
        } else {
          pm = this.allAuthoritiesFactory.createPrimeMeridian("EPSG:"
              + pmCode);
        }
      } else {
        pm = DefaultPrimeMeridian.GREENWICH;
      }
    } catch (FactoryException fe) {
      final IOException io = new GeoTiffException(metadata, fe
          .getLocalizedMessage(), fe);
      throw io;
    }

    return pm;
View Full Code Here

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

    GeodeticDatum datum = null;
    final String datumCode = metadata
        .getGeoKey(GeoTiffGCSCodes.GeogGeodeticDatumGeoKey);

    if (datumCode == null) {
      throw new GeoTiffException(
          metadata,
          "GeoTiffMetadata2CRSAdapter::createGeodeticDatum(Unit unit):A user defined Geographic Coordinate system must include a predefined datum!",
          null);
    }

    if (datumCode.equals(GeoTiffConstants.GTUserDefinedGeoKey_String)) {
      /**
       *
       *
       * USER DEFINED DATUM
       *
       *
       *
       */
      // datum name
      final String datumName = (metadata
          .getGeoKey(GeoTiffGCSCodes.GeogCitationGeoKey) != null ? metadata
          .getGeoKey(GeoTiffGCSCodes.GeogCitationGeoKey)
          : "unnamed");

      // is it WGS84?
      if (datumName.trim().equalsIgnoreCase("WGS84"))
        return DefaultGeodeticDatum.WGS84;

      // ELLIPSOID
      final Ellipsoid ellipsoid = createEllipsoid(unit, metadata);

      // PRIME MERIDIAN
      // lookup the Prime Meridian.
      final PrimeMeridian primeMeridian = createPrimeMeridian(metadata,
          unit);

      // DATUM
      datum = new DefaultGeodeticDatum(datumName, ellipsoid,
          primeMeridian);
    } else {
      /**
       * NOT USER DEFINED DATUM
       */

      // we are going to use the provided EPSG code
      try {
        datum = (GeodeticDatum) (this.allAuthoritiesFactory
            .createDatum(new StringBuffer("EPSG:")
                .append(datumCode).toString()));
      } catch (FactoryException fe) {
        final GeoTiffException ex = new GeoTiffException(metadata, fe
            .getLocalizedMessage(), fe);

        throw ex;
      } catch (ClassCastException cce) {
        final GeoTiffException ex = new GeoTiffException(metadata, cce
            .getLocalizedMessage(), cce);
        throw ex;
      }
    }

View Full Code Here

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

      //
      // /////////////////////////////////////////////////////////////////////
      return this.allAuthoritiesFactory.createEllipsoid(new StringBuffer(
          "EPSG:").append(ellipsoidKey).toString());
    } catch (FactoryException fe) {
      final GeoTiffException ex = new GeoTiffException(metadata, fe
          .getLocalizedMessage(), fe);

      throw ex;
    }
  }
View Full Code Here

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

      // make the user defined GCS from all the components...
      props.put("name", name);
      gcs = crsFactory.createGeographicCRS(props, datum,
          DefaultEllipsoidalCS.GEODETIC_2D.usingUnit(angularUnit));
    } catch (FactoryException fe) {
      final GeoTiffException io = new GeoTiffException(metadata, fe
          .getLocalizedMessage(), fe);
      throw io;
    }

    return gcs;
View Full Code Here

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

    // throw descriptive exception if ProjCoordTransGeoKey not defined
    if ((coordTrans == null)
        || coordTrans
            .equalsIgnoreCase(GeoTiffConstants.GTUserDefinedGeoKey_String)) {
      throw new GeoTiffException(
          metadata,
          "GeoTiffMetadata2CRSAdapter::createUserDefinedProjectionParameter(String name):User defined projections must specify"
              + " coordinate transformation code in ProjCoordTransGeoKey",
          null);
    }
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.