Hello

I've got problem with importing some shapefiles. Only first geometry
is returned by following code without any error message or Exception.
it.hasNext() simply returns false.
shapefile is attached with name bad.shp, repaired by program shputils
(which reads all 19 geometries) works ...
Tested on gt2-2.2.

     FeatureCollection fsShape = null;
     URL shapeURL = new java.io.File(shpFile).toURL();
     ShapefileDataStore store = new ShapefileDataStore(shapeURL);

     String name = store.getTypeNames()[0];
     FeatureSource source = store.getFeatureSource(name);

     fsShape = source.getFeatures();

     FeatureIterator it = fsShape.features();

     int count = 0;
     // procházíme jednotlivými geometriemi v shapefilu
     while (it.hasNext()) {

         Feature feature = (Feature) it.next();
         Geometry geom = feature.getDefaultGeometry();
         count++;
     }

     System.out.println("geometries: " + count);

Attachment: bad.shp
Description: Binary data

Attachment: bad.dbf
Description: Binary data

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to