Package org.geotools.data

Examples of org.geotools.data.WorldFileReader


          writer.dispose();
          coverage.dispose(true);
         
          final File finalTFW=new File(noCrsTFW.getParent(),noCrsTFW.getName().replace("tif", "tfw"));
          assertTrue(finalTFW.canRead());
          WorldFileReader worldFileReader = new WorldFileReader(finalTFW);
          assertEquals(656217.52088, worldFileReader.getXULC(), DELTA);
          assertEquals(4737594.70047, worldFileReader.getYULC(), DELTA);
          assertEquals(32.08376, worldFileReader.getXPixelSize(), DELTA);
          assertEquals(-32.0590, worldFileReader.getYPixelSize(), DELTA);
          assertEquals(0, worldFileReader.getRotationX(), DELTA);
          assertEquals(0, worldFileReader.getRotationY(), DELTA);

  }
View Full Code Here


    // We can now construct the baseURL from this string.
    File file2Parse = new File(new StringBuffer(base).append(".wld")
        .toString());

    if (file2Parse.exists()) {
      final WorldFileReader reader = new WorldFileReader(file2Parse);
      raster2Model = reader.getTransform();
    } else {
      // looking for another extension
      final Set<String> ext=WorldImageFormat.getWorldExtension(extension);
      final Iterator<String> it=ext.iterator();
      if(!it.hasNext())
        throw new DataSourceException("Unable to parse extension "+extension);
      do{
      file2Parse = new File(new StringBuffer(base).append((String)it.next()
          ).toString());
      }while(!file2Parse.exists()&&it.hasNext());
     
      if (file2Parse.exists()) {
        // parse world file
        final WorldFileReader reader = new WorldFileReader(file2Parse);
        raster2Model = reader.getTransform();
        metaFile = false;
      } else {
        // looking for a meta file
        file2Parse = new File(new StringBuffer(base).append(".meta")
            .toString());
View Full Code Here

        }

        if (worldFileExists) {

            try {
                final WorldFileReader reader = new WorldFileReader(file2Parse);
                raster2Model = reader.getTransform();

                // //
                //
                // In case we read from a real world file we have together the
                // envelope. World file transformation assumes to work in the
View Full Code Here

            // We can now construct the baseURL from this string.
            File file2Parse = new File(new StringBuilder(base).append(".wld")
                    .toString());

            if (file2Parse.exists()) {
                final WorldFileReader reader = new WorldFileReader(file2Parse);
                raster2Model = reader.getTransform();
            } else {
                // looking for another extension
                file2Parse = new File(new StringBuilder(base).append(".tfw")
                        .toString());

                if (file2Parse.exists()) {
                    // parse world file
                    final WorldFileReader reader = new WorldFileReader(
                            file2Parse);
                    raster2Model = reader.getTransform();
                }
            }
        }
        return raster2Model;
    }
View Full Code Here

            file2Parse = new File(worldFilePath + ".wld");
            worldFileExists = file2Parse.exists();
        }

        if (worldFileExists) {
            final WorldFileReader reader = new WorldFileReader(file2Parse);
            raster2Model = reader.getTransform();

            // //
            //
            // In case we read from a real world file we have together the
            // envelope. World file transformation assumes to work in the
View Full Code Here

            file2Parse = new File(worldFilePath + GridCoverageUtilities.DEFAULT_WORLDFILE_EXT);
            worldFileExists = file2Parse.exists();
        }

        if (worldFileExists) {
            final WorldFileReader reader = new WorldFileReader(file2Parse);
            raster2Model = reader.getTransform();
           
            // //
            //
            // In case we read from a real world file we have together the
            // envelope. World file transformation assumes to work in the
View Full Code Here

                .createReaderInstance();
        reader.setInput(ImageIO.createImageInputStream(tiff));
        final BufferedImage image = reader.read(0);
        reader.dispose();

        final MathTransform transform = new WorldFileReader(tfw).getTransform();
        final GridCoverage2D coverage2D = CoverageFactoryFinder.getGridCoverageFactory(null)
                .create("coverage",
                        image,
                        new GridGeometry2D(new GridEnvelope2D(PlanarImage.wrapRenderedImage(image)
                                .getBounds()), transform, DefaultGeographicCRS.WGS84),
View Full Code Here

                .createReaderInstance();
        reader.setInput(ImageIO.createImageInputStream(tiff));
        final BufferedImage image = reader.read(0);
        reader.dispose();

        final MathTransform transform = new WorldFileReader(tfw).getTransform();
        final GridCoverage2D coverage2D = CoverageFactoryFinder.getGridCoverageFactory(null)
                .create("coverage",
                        image,
                        new GridGeometry2D(new GridEnvelope2D(PlanarImage.wrapRenderedImage(image)
                                .getBounds()), transform, DefaultGeographicCRS.WGS84),
View Full Code Here

        final TIFFImageReader reader = (it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader) new TIFFImageReaderSpi()
                .createReaderInstance();
        reader.setInput(ImageIO.createImageInputStream(tiff));
        final BufferedImage image = reader.read(0);
        final MathTransform transform = new WorldFileReader(tfw).getTransform();
        final GridCoverage2D coverage2D = CoverageFactoryFinder.getGridCoverageFactory(null)
                .create("coverage" + filename,
                        image,
                        new GridGeometry2D(new GridEnvelope2D(PlanarImage.wrapRenderedImage(image)
                                .getBounds()), transform, DefaultGeographicCRS.WGS84), null, null,
View Full Code Here

                    .createReaderInstance();
            assertNotNull(reader);
            reader.setInput(ImageIO.createImageInputStream(tiff));
            final BufferedImage image = reader.read(0);

            final MathTransform transform = new WorldFileReader(tfw).getTransform();
            coverage2D = CoverageFactoryFinder.getGridCoverageFactory(null).create(
                    "coverage",
                    image,
                    new GridGeometry2D(new GridEnvelope2D(PlanarImage.wrapRenderedImage(image)
                            .getBounds()), transform, DefaultGeographicCRS.WGS84),
View Full Code Here

TOP

Related Classes of org.geotools.data.WorldFileReader

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.