Thanks Andrea, that's how I implemented it. It works fine so far.

Cheers,
Peter  

-----Original Message-----
From: Andrea Aime [mailto:[email protected]] 
Sent: Monday, December 29, 2008 2:36 PM
To: PF-Friess
Cc: [email protected]; Jesse Eichar; Jody Garnett
Subject: Re: [Geotools-devel] GeoTools 2.51. FeatureStore

PF-Friess ha scritto:
> Hi, 
> 
> I am testing GeoTools for creating shape files. I typically have to deal
> with a couple million points (~1 - 3 millions). Thereore, I am looking for
a
> way to sequentially write features to the shapfile. I repeatedly generate
a
> "FeatureCollection<SimpleFeatureType, SimpleFeature> collection", add the
> collection to the "FeatureStore<SimpleFeatureType, SimpleFeature>
> featureStore" and call transaction.commit. It seems to me that whenever I
> call transaction.commit all features in the featureStore are written to
> file, as the more features I add the slower the transaction.commit. 

Indeed, each time you commit the shapefile is fully rewritten, thus
the slowdown.

> How can I control the process of writing features to a shap file, such
that
> I can sequentially add a "FeatureCollection<SimpleFeatureType,
> SimpleFeature> collection" to the shape file?

Use a feature writer, and a single transaction, that should do it (I 
hope). Jesse, Jody, if you can provide more details...
Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Attachment: ShapeFl.java
Description: Binary data

------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to