From: Simone G. <sim...@gm...> - 2006-12-23 14:20:53
|
Ciao Kevin, it should be new Rectangle2D.Float(-180, -90,180,90) not new Rectangle2D.Float(-180, -90, 360, 180) (I guess it's a typo from Martin and I think he will give feedback on this :-) ). Anyway, I think we might find a better way to handle this using one of the GridCoverage plugins in GeoTools and setting some properties of the underlying image processing system. Unfortunately today I do not have my laptop hence no coding. Tomorrow I will send you the best code (at least IMHO :-)) along with some comments. However I would give a general advice that might come handy for whoever is interested. Your image should be more or less 3*5400*2700 kilobytes which means more or less 44 MB uncompressed, it is not *that* big but it is not even *that* small. In general jpg is a bad forma to handle big rasters because he actual decoders implemented in Java (even if in Java6 things are slightly better) are not designed for managing them. Best approach if you are going to have to deal with do I/O and visualization on them is to convert them to geotiff with tiling (and possibly overviews). Java JPEG decoder does not support tiling hence it will decompress the whole image at once. In some cases (small images) this is good since it results inv ery fast processing but with big rasters the result is using a lot of memory. Regards, Simone. On 12/23/06, Martin Desruisseaux <mar...@ge...> wrote: > Kevin Ward a =E9crit : > > As you can see, I am taking the raster image, creating an envelope > > that defines it, creating the GridCoverage2D and then resampling it. > > It seems too straight forward to actually work :-) so if anyone could > > give me some guidance it would be much appreciated. > > > It is actually almost correct, except that: > > new Rectangle2D.Float(-180, -90, bi.getWidth(), bi.getHeight()) > > should be > > new Rectangle2D.Float(-180, -90, 360, 180) > > the first form was mixing degrees and pixel units in the same geometry, w= hich is > not consistent. > > Martin > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Geotools-gt2-users mailing list > Geo...@li... > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > --=20 ------------------------------------------------------- Eng. Simone Giannecchini President /CEO GeoSolutions http://www.geo-solutions.it ------------------------------------------------------- |