|
From: César M. I. <ces...@gm...> - 2009-12-22 08:55:33
|
Hello Andreas El día 21 de diciembre de 2009 17:51, Andrea Aime <aa...@op...> escribió: > I guess the relevant part of the code is contained in a loop? > > Two suggestions: > - create a SimpleFeatureBuilder outside of the loop and reuse it to > build all features Well, it is not in a loop, but is in an "addFeature" method which is called repeatedly in a loop. Maybe I'll cache the FeatureBuilder, but anyway I was measuring times of each part, and only some miliseconds were spent on that part of the code. Almost the full 5 minutes were spent in the "store.addFeatures(collection);" line. > - create a new Transaction, set it in the store (that you will get just > once) That sounds more interesting for me. I'm going to try this, but I'd like to know the consequences of it. By doing so, does it mean that features are not written to disk until the transaction is complete? This is important for me, as I'll create sometimes shapefiles > 1GB, so I shouldn't do this on memory. If that is really the effect, I guess I could create a transaction every 1000 features or so. Thanks for the tips! I'll report back my results. César > - then loop and add > - when the loop is done commit the transaction > > Cheers > Andrea > > > -- > Andrea Aime > OpenGeo - http://opengeo.org > Expert service straight from the developers. > -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - César Martínez Izquierdo GIS developer - - - - - - - - - - - - - - - - - - - - ETC-LUSI: http://etc-lusi.eionet.europa.eu/ Universitat Autònoma de Barcelona (SPAIN) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |