Hello Andreas El día 21 de diciembre de 2009 17:51, Andrea Aime <[email protected]> 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) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
