[Gvsig_english] fnMap library - issue in raster image resampling

Aldo Stracquadanio aldo.strac at gmail.com
Mon Sep 14 15:10:03 CEST 2009


Hi,

I'm developing an application using gvSIG components and project
format, but I noticed that in the pilot I can't get a raster layer
correctly displayed. I read some code and I think that the issue
should be in rows 352-359 of the file
es/prodevelop/gvsig/mobile/fmap/driver/raster/memory/wkformat/WKFRasterDriver.java:

                                Image smallImage = wholeImage.getScaledInstance(
						raster_transf[2],
						raster_transf[3],
						Image.SCALE_FAST);
				if ((smallImage == null) || (smallImage.getWidth(null) !=
raster_transf[2])) {
					throw new FMapDriverException("Could not resample image (down).");
				}

Javadocs of PhoneME reports in fact that Image.getScaledInstance may
have an asynchronus behaviour; during the resampling accessing width
and height of the image will always give a value of -1, resulting in
the FMapDriverException. I solved this commenting all the reported
rows and changing row 364 this way:

g.drawImage(wholeImage, raster_transf[0], raster_transf[1], null); ->
g.drawImage(wholeImage, raster_transf[0], raster_transf[1],
raster_transf[2], raster_transf[3], null);

Now I can render my raster correctly, but I noticed that
georeferencing done on the desktop edition isn't working in the
exported project; can someone help about this?

I'm sorry for my poor english, I hope this will be useful for the
developement of this software.


More information about the Gvsig_internacional mailing list