It looks like you already have all your points in memory by means of 
your "allPoints" map.
One thing that you should check is you're not running low on heap memory 
(even if not creating the in-memory FeatureCollection).

By the other hand, the approach I would probably take is to create my 
own implementation of FeatureCollection, probably as a private static 
class, which is backed directly by your collection of XyzPoint objects, 
and that returns an iterator (both at iterator() and 
features():FeatureIterator() that work over an iterator on the 
Collection<XyzPoint> and builds the features on demand (ie, on the 
next() method).

Hope that helps.
Gabriel

On 4/19/10 5:22 PM, Oliver Gottwald wrote:
> Hi,
>
> I have a model with 120000+ points.  It slows at load time to 15-40 seconds 
> per 1000.  I think that the issue is that I'm using the default 
> FeatureCollection.
>
> Should I use a DataFeatureCollection?  If so does anyone have an example of 
> implementation for DataFeatureCollection?
>
> What FeatureCollection is best to use when loading large sets of data?
>
> I'm using the below basic approach(extract from other simpler program) but 
> adding a lot of points:
> FeatureCollection collection = FeatureCollections.newCollection();
>      GeometryFactory factory = JTSFactoryFinder.getGeometryFactory(null);
>
>        ArrayList coordList = new ArrayList();
>        Collection cl = allPoints.values();
>        Iterator it = cl.iterator();
>        while (it.hasNext()){
>            XyzPoint xyz = (XyzPoint)it.next();
>            coordList.add(new Coordinate(xyz.getX(),xyz.getY()));
>            //featureBuilder.set("name",xyz.getName());
>        }
>
>        Coordinate[] coords = CoordinateArrays.toCoordinateArray(coordList);
>        LineString lineString = factory.createLineString(coords);
>
>        //featureBuilder.set("name", "testing123");
>        featureBuilder.add(lineString);
>        collection.add(featureBuilder.buildFeature(null));
>
> Oliver
>
>
> -----Original Message-----
> From: "Richard Marshall"<[email protected]>
> Sent: Monday, April 19, 2010 3:17pm
> To: [email protected]
> Subject: Re: [Geotools-gt2-users] Shapefile pregeneralization
>
>
> Hi Christian
>
> I finally managed to get something working.  I had not added the new feature
> type name ('GenRoads') to the FeatureTypeStyle for the pregeneralized shape
> file.  The following two lines (added to the code that creates the line
> style for the shape file) fixed the problem:
>
>      featureTypeStyle.featureTypeNames().clear();
>      featureTypeStyle.featureTypeNames().add(new NameImpl("GenRoads"));
>
> Thanks,
> Richard
>
>
>
> ------------------------------------------------------------------------------
> Download Intel&#174; Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
>
>
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users


-- 
Gabriel Roldan
OpenGeo - http://opengeo.org
Expert service straight from the developers.

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

Reply via email to