[udig-devel] [solved] raster's data recovery
ragga doll
raggadoll99 at yahoo.fr
Fri Apr 25 12:21:17 PDT 2008
Thanks, I have done ! Also uDig didn't want to render my raster because he have not got enough memory. Now, with this code and -Xmx250m directive, it's work fine.
GridCoverageFactory fact = new GridCoverageFactory();
Map map = (Map) ApplicationGIS.getActiveMap() ;
Layer l = (Layer) map.getMapLayers().get(0) ;
int tabValue[] = null ;
File file = new File(l.getID().getFile());
BufferedImage buffer = ImageIO.read(file);
Envelope envelope = l.getBounds(null, l.getCRS()) ;
GridCoverage2D grid = fact.create("name", buffer, envelope) ;
Point2D.Double pixel = new Point2D.Double(-60.740 , -7.109);
tabValue = grid.evaluate(pixel, tabValue) ;
String msg = "begin";
for(int i = 0 ; i < tabValue.length ; i++)
msg += "\n*" + tabValue[i] ;
System.out.println(msg + "\nend");
__________________________________________________
Do You Yahoo!?
En finir avec le spam? Yahoo! Mail vous offre la meilleure protection possible contre les messages non sollicités
http://mail.yahoo.fr Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20080425/d3bf6823/attachment.html
More information about the udig-devel
mailing list