Hi Gaby,

Two questions.

Do you know the original geographic/projected coordinate system of the file? Do 
you have the world file containing the information?

A full stacktrace is very helpful. Could you please supply this?

Brett

-----Original Message-----
From: gaby [mailto:[email protected]] 
Sent: Tuesday, 23 July 2013 8:40 AM
To: [email protected]
Subject: [Geotools-gt2-users] Examples of doing reprojections of georeferenced 
PNG images

Hello,
Are there any recent examples on how to reproject images (rasters)? I am using 
geotools 9.3. 
I've tried following the example in the tutorial 
http://docs.geotools.org/stable/userguide/library/coverage/grid.html. 
My code:

try
{
      File rasterFile = new File("TestData/heathcote_200_depth.png");
      AbstractGridFormat format = GridFormatFinder.findFormat( rasterFile );
      AbstractGridCoverage2DReader reader = format.getReader(rasterFile);
      GridCoverage2D myGridCov = reader.read(null);
      GridCoverage2D reprojected = (GridCoverage2D) 
Operations.DEFAULT.resample(myGridCov,CRS.decode("EPSG:2193"));
} catch (Exception e {
   .....
}

But I get the error:

org.geotools.coverage.processing.CannotReprojectException: Can't reproject grid 
coverage "heathcote_200_depth".
...........
...........
Caused by: org.opengis.referencing.operation.OperationNotFoundException:
Bursa wolf parameters required.

Also, how do I write out the reprojected grid coverage out to file again? 
Thanx
Gaby



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Examples-of-doing-reprojections-of-georeferenced-PNG-images-tp5068068.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics Get end-to-end 
visibility with application monitoring from AppDynamics Isolate bottlenecks and 
diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to