zhikrullah / pyshp

Automatically exported from code.google.com/p/pyshp
MIT License
0 stars 0 forks source link

Pyshp fails without error on invalid DBF files #45

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Load example shapefile from 
http://gis.stackexchange.com/questions/50264/how-to-get-text-attributes-from-sha
pefile-with-python-pyshp/
2. r = shapefile.Reader(
3. len(r.records())

What is the expected output? What do you see instead?

len(r.records()) is 0, I expected 59117.

Please provide any additional information below.

As I noted in my answer on 
http://gis.stackexchange.com/questions/50264/how-to-get-text-attributes-from-sha
pefile-with-python-pyshp/ the DBF file is invalid. It uses an illegal value for 
the DBF deleted flag. Pyshp should either ignore this (I've never seen a DBF 
file in Shapefile context with actual deleted fields) or raise an exception 
upon illegal value.

Perhaps raise an exception by default and provide a lenient mode that ignores 
the flag?

Original issue reported on code.google.com by tlaurino...@gmail.com on 7 Feb 2013 at 3:51

GoogleCodeExporter commented 8 years ago

Original comment by jlawh...@geospatialpython.com on 2 May 2013 at 4:54