Hello. I've been trying to read a shapefile using the 2.4-SNAPSHOT and I've 
been partly succesful. The sample code I've written to test this is the 
following :

File file = new File("C:\\Workspace\\datastores\\DD_MK.shp");
        Map map = new HashMap();
        map.put( "url", file.toURL() );
        DataStore dataStore = DataStoreFinder.getDataStore(map);
        FeatureSource fsource = dataStore.getFeatureSource( "DD_MK" );
        FeatureCollection fc = fsource.getFeatures();
        Iterator i = fc.iterator();
        while (i.hasNext()) {
            Feature feature = (Feature) i.next();
            System.out.println(feature.getAttribute("REAL_POP"));
        }
        fc.close(i);

It works, but when I try to retrieve an attribute that is written in the greek 
language, i get garbage like "??????". Is there a way to set the character 
encoding which is to be read by the datastore ? Or any other way of solving 
this prolem ? Any indication would be appreciated.

Nick Lefkaditis




 
____________________________________________________________________________________
Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to