Ack - reading your code also scared me - the fColl.getCount() is not 
really going to save you much time (to produce a count it would need to 
go through the entire dataset after all - try isEmpty instead).

I have started to collect an example here:
- http://docs.codehaus.org/display/GEOTDOC/01+FeatureCollection+Iterator

And will see that it is placed in the user manual proper when I next 
talk to Adrian Custer.
Jody
> Dear Jody Garnette,
>    FidFilter works good, thank you, and following is the code I have 
> used ..
>
>
>   FeatureCollection fColl = null;
>    FilterFactory filterFactory = 
> FilterFactoryFinder.createFilterFactory();
>    FidFilter filter = null;
>    filter = filterFactory.createFidFilter();
>       FeatureType featureType = mapLayer.getFeatureSource().getSchema();
>       filter.addFid(fid);
>       fColl = mapLayer.getFeatureSource().getFeatures(filter);
>        if(fColl.getCount() > 0){
>       FeatureReader reader = fColl.reader();
>       while(reader.hasNext()) {
>        feature = (Feature) reader.next();
>       }
>       }
> //       System.out.println("Fcollection=" + fColl.getCount());
>       break;
>     }
> Best Regards
>  Govardhan


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to