Shape file does not load
------------------------

                 Key: GEOT-943
                 URL: http://jira.codehaus.org/browse/GEOT-943
             Project: GeoTools
          Issue Type: Bug
          Components: data shapefile
    Affects Versions: 2.2.0
            Reporter: Jesse Eichar
         Assigned To: Ian Wolfe Schneider
         Attachments: bad.dbf, bad.shp

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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

-------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to