Hi,

I was using GeoTiffReader from GT2 to parse a GeoTiff file when I came accross the exception at the end of this message.

Now, according to section 2.6.1 of the GeoTiff specification (http://www.remotesensing.org/geotiff/spec/geotiff2.6.html#2.6 ), when the ModelTransformationTag is not available and there is a single ModelTiePoint, the transformation from between model space and raster space can be derivied using the information from the tie point and the ModelPixelScale data. The matrix representing the transformation is shown at the aforementioned link.

However, the method createUserDefinedProjectionParameter() in GeoTiffMetadata2CRSAdapter.java is not creating the proper transformation according that section of the GeoTiff specification. Instead, that method is choking because no ProjCoordTransGeoKey is available in the GeoTiff file even though there is sufficient information available for deriving what the projection should be.

The simplest solution is to compute the matrix representation of the user-defined transformation and create the proper ProjectionCRS object based on that. However, before I submit a patch, I need to know if I'm on the right path. Am I missing anything from the specification ?

Thanks,

Romeo

org.geotools.data.DataSourceException: GEOTIFF Module Error Report
GeoTiffMetadata2CRSAdapter ::createUserDefinedProjectionParameter(String name):User defined projections must specify coordinate transformation code in ProjCoordTransGeoKey
ModelPixelScaleTag: [0.0048042791094009985,0.004804279109400998,0.0]
ModelTiePointTag: (1 tie points)
TP #0: [0.0,0.0,0.0] -> [-2.760058348350874,8.505976163194468,0.0]
ModelTransformationTag: NOT AVAILABLE
GeoKey #1: Key = 1, Value = null
GeoKey #2: Key = 1024, Value = 1
GeoKey #3: Key = 1025, Value = 1

at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java: 256)
        at GeoTiff.TiffTags$GetImageTask.displayImage(TiffTags.java:234)
        at GeoTiff.TiffTags$GetImageTask.run(TiffTags.java:154)
        at java.lang.Thread.run(Thread.java:637)
Caused by: org.geotools.coverage.grid.io.imageio.geotiff.GeoTiffException: GEOTIFF Module Error Report GeoTiffMetadata2CRSAdapter ::createUserDefinedProjectionParameter(String name):User defined projections must specify coordinate transformation code in ProjCoordTransGeoKey
ModelPixelScaleTag: [0.0048042791094009985,0.004804279109400998,0.0]
ModelTiePointTag: (1 tie points)
TP #0: [0.0,0.0,0.0] -> [-2.760058348350874,8.505976163194468,0.0]
ModelTransformationTag: NOT AVAILABLE
GeoKey #1: Key = 1, Value = null
GeoKey #2: Key = 1024, Value = 1
GeoKey #3: Key = 1025, Value = 1

at org .geotools .coverage .grid .io .imageio .geotiff .GeoTiffMetadata2CRSAdapter .createUserDefinedProjectionParameter(GeoTiffMetadata2CRSAdapter.java: 1140) at org .geotools .coverage .grid .io .imageio .geotiff .GeoTiffMetadata2CRSAdapter .createUserDefinedPCS(GeoTiffMetadata2CRSAdapter.java:695) at org .geotools .coverage .grid .io .imageio .geotiff .GeoTiffMetadata2CRSAdapter .createProjectedCoordinateSystem(GeoTiffMetadata2CRSAdapter.java:297) at org .geotools .coverage .grid .io .imageio .geotiff .GeoTiffMetadata2CRSAdapter .createCoordinateSystem(GeoTiffMetadata2CRSAdapter.java:234) at org.geotools.gce.geotiff.GeoTiffReader.getHRInfo(GeoTiffReader.java:308) at org.geotools.gce.geotiff.GeoTiffReader.<init>(GeoTiffReader.java: 235)
        ... 3 more


-------------------------
This e-mail and any attachments may contain confidential material for the sole 
use of the intended recipient. If you are not the intended recipient, please be 
aware that any disclosure, copying, distribution or use of this e-mail or any 
attachment is prohibited. If you have received this e-mail in error, please 
contact the sender and delete all copies.
Thank you for your cooperation
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to