Hi Jody, Jon,

> For reference here is the sample code I ended up with:
>  GridCoverage2D gradient = (GridCoverage2D) 
> Operations.DEFAULT.gradientMagnitude( dem );
>  RenderedImage rawImage = gradient.getRenderedImage();
>
>  ImageWorker worker = new ImageWorker( rawImage );
>  worker.binarize(maxSlope);
>
>  RenderedImage processed = worker.getRenderedImage();
>  GridCoverageFactory fac = CoverageFactoryFinder.getGridCoverageFactory(null);
>
>  GridCoverage2D slope = fac.create( "slope", processed, dem.getEnvelope() );

Yep. That's pretty much how I do it. Jon's method of resorting
directly to JAI will accomplish the same thing that ImageWorker does.

It looks like you can also use
org.geotools.coverage.processing.BilevelOperation giving "binarize" as
the operation name to the constructor. I haven't tried this approach -
just found it by grepping the source. It's fairly well camouflaged
from users :-(

Michael

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to