[
http://jira.codehaus.org/browse/GEOT-344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrea Aime reopened GEOT-344:
------------------------------
Assignee: Andrea Aime
The issue is not resolved until the patches are commited to the Geotools trunk.
Providing a patch is the first step, someone has to review and commit it.
> "java.io.IOException: Dbf has extra record" when opening Shapefile
> ------------------------------------------------------------------
>
> Key: GEOT-344
> URL: http://jira.codehaus.org/browse/GEOT-344
> Project: GeoTools
> Issue Type: Bug
> Components: data shapefile
> Affects Versions: 2.1.M0, 2.1.M1, 2.1.M2
> Environment: java2-jre-1.4.2 on SuSE9.0
> j2sdk-1_4_2_06-windows-i586-p on WinXP
> Reporter: Christian Pschierer
> Assignee: Andrea Aime
> Fix For: 2.1.0
>
> Attachments: ape.zip, shapefile-indexzero.diff,
> ShapefileDataStore.java, ShapefileReader.java, testShapefile.zip
>
>
> When opening ESRI shapefiles with the ShapefileDataStore (see code below),
> some shapefiles produce an java.io.IOException ("Dbf has extra record").
> The affected shapefiles itself are ok. They can be opened by ArcInfo,
> ArcExplorer or e.g. shapelib without problems. A sample shapefile can be
> found at http://132.187.42.13/~pschirus/testShapefile.zip (16kB).
> The stacktrace is:
> java.io.IOException: Dbf has extra record
> at
> org.geotools.data.shapefile.ShapefileDataStore$Reader.hasNext(ShapefileDataStore.java:417)
> at org.geotools.data.FIDFeatureReader.hasNext(FIDFeatureReader.java:133)
> at
> org.geotools.data.DefaultFeatureResults.collection(DefaultFeatureResults.java:227)
> Testcase to reproduce the error:
> URL url = new URL( "file:///apron.shp" );
> // Create new datastore of the provided shapefile
> ShapefileDataStore store = new ShapefileDataStore( url );
> // Get filename, e.g. "runway"
> String storename = store.getTypeNames()[ 0 ];
> // Create feature source
> FeatureSource source = store.getFeatureSource( storename );
> // Read attribute data from the feature source.
> FeatureResults fResults = source.getFeatures();
> // Get the FeatureType. The FeatureType contains the attribute
> // definitions of the shapefile.
> featureType = source.getSchema();
> // Create the FeatureCollection with all data from the
> FeatureResults.
> featureCollection = fResults.collection();
>
> System.out.println( "Completed successfully");
--
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
------------------------------------------------------------------------------
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel