final Rectangle actualDim = new Rectangle(0, 0, hrWidth, hrHeight);
originalGridRange = new GridEnvelope2D(actualDim);
final IIOMetadata iioMetadata = reader.getImageMetadata(0);
GeoTiffIIOMetadataDecoder metadata = new GeoTiffIIOMetadataDecoder(iioMetadata);
if (metadata.hasNoData())
noData = metadata.getNoData();
// //
//
// get the CRS INFO
//
// //
// metadata decoder
GeoTiffMetadata2CRSAdapter gtcs=new GeoTiffMetadata2CRSAdapter(hints);
final Object tempCRS = this.hints.get(Hints.DEFAULT_COORDINATE_REFERENCE_SYSTEM);
if (tempCRS != null) {
this.crs = (CoordinateReferenceSystem) tempCRS;
if (LOGGER.isLoggable(Level.FINE))
LOGGER.log(Level.FINE, "Using forced coordinate reference system");
} else {
// check metadata first
if (metadata.hasGeoKey()&& gtcs != null)
crs = gtcs.createCoordinateSystem(metadata);
if (crs == null)
crs = GeoTiffUtils.getCRS(source);
}
if (crs == null){
if(LOGGER.isLoggable(Level.WARNING)){
LOGGER.warning("Coordinate Reference System is not available");
}
crs = AbstractGridFormat.getDefaultCRS();
}
if (gtcs != null&& metadata!=null&& (metadata.hasModelTrasformation()||(metadata.hasPixelScales()&&metadata.hasTiePoints()))) {
this.raster2Model = GeoTiffMetadata2CRSAdapter.getRasterToModel(metadata);
} else {
this.raster2Model = GeoTiffUtils.parseWorldFile(source);
}