Package org.geotools.coverage.grid.imageio.geotiff.metadata

Examples of org.geotools.coverage.grid.imageio.geotiff.metadata.GeoTiffIIOMetadataDecoder


            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);
            }
   
View Full Code Here


                return false;
            }
            //
            // parse metadata and be resilient with CRS
            //
            final GeoTiffIIOMetadataDecoder metadataAdapter = new GeoTiffIIOMetadataDecoder(metadata);
            if (!metadataAdapter.hasGeoKey() && LOGGER.isLoggable(Level.FINE)) {
                LOGGER.fine("Unable to find geokey directory for this tif file");
            }

            //
            // analyze georeferencing
            //
            // do we have verything as geotiff?
            if (metadataAdapter.hasModelTrasformation() ||
                    (metadataAdapter.hasPixelScales() && metadataAdapter.hasTiePoints())){
                return true;
            }

            // now look for info into a WLD file
            MathTransform raster2Model = GeoTiffUtils.parseWorldFile(o);
View Full Code Here

TOP

Related Classes of org.geotools.coverage.grid.imageio.geotiff.metadata.GeoTiffIIOMetadataDecoder

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.