Hi Vicente,
I had to cope with the same (within an SwtMapPane).
You might use the ImageUtilities.maskColor() methos from
org.geotools.resources.image:
================================================
final File img = new File("/path/to/raster");
final AbstractGridFormat imgFormat = GridFormatFinder.findFormat(img);
final GridCoverage2DReader imgReader = imgFormat.getReader(img);
[...]
GridCoverage2D imgCov = imgReader.read(<params>);
RenderedImage img = imgCov.getRenderedImage();
img = ImageUtilities.maskColor(<BG_COLOR>, img);
if (img instanceof RenderedOp) {
img = ((RenderedOp) img).getAsBufferedImage();
}
imgCov = GridCoverageFactory().create(imgCoverage.getName().toString(),
img, imgCoverage.getEnvelope());
================================================
Then you can add the imgCov to the JMapFrame.
hth,
-Piero
On 16 January 2017 at 17:36, <
geotools-gt2-users-requ...@lists.sourceforge.net> wrote:
>
> Hi!
>
> I want to show with GeoTools a raster map, but I hava a lots of points
> with the value of -9999, so I can`t show the map as I would want.
>
> Someone know how I can to hide those points in my map?
> Is it exits some kind of gradient to fix the maximum and mininum
> values to show in the JMapFrame?
>
> Thanks
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users