Thanks for the clarification.

I had 1mil features that I want to parse out of a DB and write into a shape
file, my first naive implementation was to read all 1mil into one
featureCollection, then start a dataStore, and do
dataStore.addFeatures(collection)

but that ran into OutOfHeap exception, since the 1mil features took up too
much mem.
then I tried reading out 1000 features at at time, and put them into a
smaller feature collection, add the small feature collection into the
dataStore. ----- but according to what you said, this does not make it any
better, right? whenever a new featureCollection is added, it would have to
pull out the entire existing dataStore contents, and rewrite it? so still
the same memory for 1mil features will be needed?

Thanks
Yang


On Wed, Feb 1, 2012 at 11:25 PM, Andrea Aime
<[email protected]>wrote:

> On Thu, Feb 2, 2012 at 1:54 AM, Yang <[email protected]> wrote:
> > currently I collect all my features into one FeatureCollection,
> > and then store them by
> >
> > shapeFileDataStore.addFeatures(collection)
> >
> >
> > I assume the latter call writes the collection to disk, updating indexes
> (in
> > the case of IndexedShapeFileDataStore).
> >
> > my question is, is it possible to write multiple collections into the
> > dataStore before the store is closed ?
>
> Yes, create a transaction, associate it with the store, do all the
> adds you need, commit _and_ close the transaction
>
>  in that case,
> > will the index be properly updated (like B-Tree implementation ) ?
>
> The spatial index will be updated. Actually the way things work
> the whole shapefile gets rewritten, and so does the index
> (the current implementation does not support in-place modification
> of the shapefile)
>
> Cheers
> Andrea
>
> --
> -------------------------------------------------------
> Ing. Andrea Aime
> GeoSolutions S.A.S.
> Tech lead
>
> Via Poggio alle Viti 1187
> 55054  Massarosa (LU)
> Italy
>
> phone: +39 0584 962313
> fax:      +39 0584 962313
> mob:    +39 339 8844549
>
> http://www.geo-solutions.it
> http://geo-solutions.blogspot.com/
> http://www.youtube.com/user/GeoSolutionsIT
> http://www.linkedin.com/in/andreaaime
> http://twitter.com/geowolf
>
> -------------------------------------------------------
>
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to