Hi Jiri,

Please see my comments inline:

> This is my code:
>
>        FeatureCollection<SimpleFeatureType,SimpleFeature> collection =
>          RasterToVectorProcess.process(cov, band, bounds, outsideValues,
> insideEdges, null);
>
>        FeatureIterator<SimpleFeature> iterator = collection.features();
>        try {
>            while( iterator.hasNext() ){
>                SimpleFeature feature = iterator.next();
>                System.out.println(feature.getDefaultGeometry().getClass());
>            }
>        }
>        finally {
>            iterator.close();
>        }
>
>        GeometryFactory gf = new GeometryFactory();
>        MultiPolygon mp = gf.createMultiPolygon( collection.toArray(new
> Polygon[0]) );

Ah... I've given you a bum steer sorry. I hadn't ready your previous
email and was thinking you were using the JAITools operator with
Collection<Polygon> output. Sorry about that.

The RasterToVectorProcess is giving you a SimpleFeatureCollection
where the Geometry type is Polygon. Do you want to convert each of
these to individual MultiPolygons or combine all of them into a single
MultiPolygon ?  I just want to check so that I don't send you off in
the wrong direction again :)

> 1) many info logs about EPSG initialization - is there a way to get rid of
> it? E.g. set the geotools log level to warning?

Those log messages were recently changed to Level.FINE on trunk
(8.0-SNAPSHOT). Are you using the most recent binaries ?

> 3) And then it falls at line: "MultiPolygon mp = gf.createMultiPolygon(
> collection.toArray(new Polygon[0]) );" raising exception of incorrect
> storing (allthought the types seems to correspond).

That's because I told you to do the wrong thing.

Michael

------------------------------------------------------------------------------
Got Input?   Slashdot Needs You.
Take our quick survey online.  Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to