svn - r33506 - branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak

1 message Options
Embed this post
Permalink
svn_geotools

svn - r33506 - branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak

Reply Threaded More More options
Print post
Permalink
Author: danieleromagnoli
Date: 2009-07-07 07:06:11 -0400 (Tue, 07 Jul 2009)
New Revision: 33506

Modified:
   branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KFormat.java
   branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KReader.java
   branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/RasterManager.java
Log:
Added default suggested tile size. Minor typo fixed

Modified: branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KFormat.java
===================================================================
--- branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KFormat.java 2009-07-07 07:42:11 UTC (rev 33505)
+++ branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KFormat.java 2009-07-07 11:06:11 UTC (rev 33506)
@@ -92,7 +92,7 @@
      * representing the suggested tileHeight.
      */
     public static final DefaultParameterDescriptor<String> SUGGESTED_TILE_SIZE = new DefaultParameterDescriptor<String>(
-            SUGGESTED_TILESIZE, String.class, null, "");
+            SUGGESTED_TILESIZE, String.class, null, "512,512");
 
     public static final String TILE_SIZE_SEPARATOR = ",";
 

Modified: branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KReader.java
===================================================================
--- branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KReader.java 2009-07-07 07:42:11 UTC (rev 33505)
+++ branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/JP2KReader.java 2009-07-07 11:06:11 UTC (rev 33506)
@@ -59,6 +59,7 @@
 import org.geotools.data.WorldFileReader;
 import org.geotools.factory.Hints;
 import org.geotools.geometry.GeneralEnvelope;
+import org.geotools.metadata.iso.spatial.PixelTranslation;
 import org.geotools.referencing.CRS;
 import org.geotools.referencing.operation.LinearTransform;
 import org.geotools.referencing.operation.transform.ProjectiveTransform;
@@ -70,6 +71,7 @@
 import org.opengis.parameter.GeneralParameterValue;
 import org.opengis.referencing.FactoryException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.datum.PixelInCell;
 import org.opengis.referencing.operation.MathTransform;
 import org.opengis.referencing.operation.TransformException;
 
@@ -102,19 +104,19 @@
 
     static{
  try{
- //check if our tiff plugin is in the path
+ //check if our jp2k plugin is in the path
  final String kakaduJp2Name=it.geosolutions.imageio.plugins.jp2k.JP2KKakaduImageReaderSpi.class.getName();
  Class.forName(kakaduJp2Name);
 
- // imageio tiff reader
+ // imageio jp2k reader
  final String standardJp2Name=com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReaderSpi.class.getName();
 
  final boolean succeeded=ImageIOUtilities.replaceProvider(ImageReaderSpi.class, kakaduJp2Name, standardJp2Name, "JPEG2000");
          if(!succeeded)
-         LOGGER.warning("Unable to set ordering between tiff readers spi");
+         LOGGER.warning("Unable to set ordering between JP2K readers spi");
         
  } catch (ClassNotFoundException e) {
- LOGGER.log(Level.SEVERE,"Unable to load specific TIFF reader spi",e);
+ LOGGER.log(Level.SEVERE,"Unable to load specific JP2K reader spi",e);
  }
         
  }
@@ -543,17 +545,13 @@
             // CELL_CENTER condition
             //
             // //
-            final AffineTransform tempTransform = new AffineTransform(
-                    (AffineTransform) raster2Model);
-            tempTransform.preConcatenate(Utils.CENTER_TO_CORNER);
-
+            
+            MathTransform tempTransform =PixelTranslation.translate(raster2Model, PixelInCell.CELL_CENTER, PixelInCell.CELL_CORNER);
             try {
-                final LinearTransform gridToWorldTransform = ProjectiveTransform
-                        .create(tempTransform);
                 final Envelope gridRange = new GeneralEnvelope(
                         originalGridRange.toRectangle());
                 final GeneralEnvelope coverageEnvelope = CRS.transform(
-                        gridToWorldTransform, gridRange);
+                 tempTransform, gridRange);
                 originalEnvelope = coverageEnvelope;
             } catch (TransformException e) {
                 if (LOGGER.isLoggable(Level.WARNING)) {

Modified: branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/RasterManager.java
===================================================================
--- branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/RasterManager.java 2009-07-07 07:42:11 UTC (rev 33505)
+++ branches/2.5.x/modules/unsupported/jp2kakadu/src/main/java/org/geotools/coverageio/jp2kak/RasterManager.java 2009-07-07 11:06:11 UTC (rev 33506)
@@ -410,7 +410,7 @@
 
  public RasterManager(final JP2KReader reader) throws DataSourceException {
 
- Utils.ensureNonNull("ImageMosaicReader", reader);
+ Utils.ensureNonNull("JP2KReader", reader);
  this.parent=reader;
  this.expandMe=parent.expandMe;
         inputURL = reader.sourceURL;


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
GeoTools-commits mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geotools-commits