Thanks Michael!

What I mean "faster" is faster for zooming, panning, and generally in
responding. The quickstart app gave slow response while I am loading a
certain shapefile (perhaps it's too big?). With the FeatureCollection
you just showed, it is much better now.

On Sat, Dec 19, 2009 at 5:11 PM, Michael Bedward
<[email protected]> wrote:
> Hi Nano,
>
> Forgive me for answering your question with a question but faster for what ?
>
> If you can provide some information about your application, ie. the
> types of operations that you are doing with the data, it would help
> folk here suggest approaches that are relevant to your case.
>
> Meanwhile, here is the Quickstart main method, modified to load all
> features into memory before displaying them. You might like to try
> this with your data.
>
>    public static void main(String[] args) throws Exception {
>        // display a data store file chooser dialog for shapefiles
>        File file = JFileDataStoreChooser.showOpenFile("shp", null);
>        if (file == null) {
>            return;
>        }
>
>        FileDataStore store = FileDataStoreFinder.getDataStore(file);
>        FeatureSource featureSource = store.getFeatureSource();
>
>        FeatureCollection<SimpleFeatureType, SimpleFeature> memColl =
> FeatureCollections.newCollection();
>        memColl.addAll(featureSource.getFeatures());
>
>        // Create a map context and add our shapefile to it
>        MapContext map = new DefaultMapContext();
>        map.setTitle("Quickstart");
>        map.addLayer(memColl, null);
>
>        // Now display the map
>        JMapFrame.showMap(map);
>    }
>
>
> Hope this helps,
>
> Michael
>

------------------------------------------------------------------------------
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

Reply via email to