Skip to content

Failed to read .dbf files (even for example) #1

Description

@fdubois-geophy

Hi, I just ran your code but it failed. There are some minor changes for string assertion in python3. But I encountered a trickier error with your dbf file reader. I paste the error message below:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
root: points
Reading .shp file from:
C:\Users\dubois\PyGTV-master\src\examples\ex1\points.shp
Reading header...

Shape file (.shp):

  • Src: C:\Users\dubois\PyGTV-master\src\examples\ex1\points.shp
  • Type: POINT
  • shapes: 3

========================================
Reading .dbf file from:
C:\Users\dubois\PyGTV-master\src\examples\ex1\points.dbf
Version: b'03'
b' 1P1 0.556000000000 320190101 2P3 0.987650000000 120190106 3P2 0.543200000000 420190107\x1a'
+++ +++
id
1
Traceback (most recent call last):

File "C:\Users\dubois\PyGTV-master\src\examples\points.py", line 28, in
db = FileDbf.read(src_dbf)

File "C:\Users\dubois\Anaconda3\lib\site-packages\gtv\files\dbf.py", line 311, in read
fdbf.read_record(b, convert_records)

File "C:\Users\dubois\Anaconda3\lib\site-packages\gtv\files\dbf.py", line 223, in read_record
v = f.value(s)

File "C:\Users\dubois\Anaconda3\lib\site-packages\gtv\files\dbf.py", line 79, in value
assert False, "Not recognized type"

AssertionError: Not recognized type
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
It seems we have an error while reading the dbf file. Variable "s" is empty in my case but contains strange values for your points.py

Cheers

Fred

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions