Hi Michael,
thanks for leading me :)
Also answering inlines...
On 07/26/2011 11:19 PM, Michael Bedward wrote:
> 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 :)
>
I need to obtain just one MultiPolygon as the combination
(dissolve/merge) of those in SimpleFeatureCollection.
>> 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 ?
>
I hope so, I am using this maven configuration:
...
<!-- === Versions of used frameworks and libraries === -->
<properties>
...
<org.geotools.version>8.0-M1</org.geotools.version>
...
</properties>
<repositories>
<repository>
<id>OSGEO GeoTools repo</id>
<url>http://download.osgeo.org/webdav/geotools</url>
</repository>
...
</repositories>
Is the right repository for the latest artifacts?
Jiri
>> 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