I was trying to read a shapefile and print all it's features on screen
but i couldn't find what the type name was so i am having problems and
this is the code

 File file = new File("ex/example.shp");
        Map map = new HashMap();
        map.put( "url", file.toURL() );
        DataStore dataStore = DataStoreFinder.getDataStore(map );

        SimpleFeatureSource featureSource =
dataStore.getFeatureSource("typename"); ====>what should i put instead
of typename? and how would i know it?
        SimpleFeatureCollection collection = featureSource.getFeatures();

        SimpleFeatureIterator iter =collection.features();
        while(iter.hasNext())
        {
            SimpleFeature feature = iter.next();
            System.out.println(feature);
        }
        iter.close();

thank you :D

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to