#3396: db.in.ogr fails with .dbf files created with Visual Foxpro
-------------------------+-------------------------
Reporter: maitl | Owner: grass-dev@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: Database | Version: 7.2.1
Keywords: | CPU: Unspecified
Platform: MSWindows 7 |
-------------------------+-------------------------
Import of .dbf table created with Visual Foxpro ends with "ERROR: Input
DSN <C:\mytable.dbf> not found or not readable" . The problem is probably
related to the .dbf file header where file structure is described
(https://msdn.microsoft.com/en-us/library/aa975386(v=vs.71).aspx).
When I converted the problematic table in Visual Foxpro environment to
Foxpro 2.x format (command COPY TO mytable_fox26x TYPE FOX2X), then
dbf.in.ogr works.
If fixing the issue is complicated, then I suggest to add a note to manual
that "dBASE tables created with Visual Foxpro are not supported" and a
recommendation how to proceede.
#3396: db.in.ogr fails with .dbf files created with Visual Foxpro
--------------------------+-------------------------
Reporter: maitl | Owner: grass-dev@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: Database | Version: 7.2.1
Resolution: | Keywords:
CPU: Unspecified | Platform: MSWindows 7
--------------------------+-------------------------
Comment (by martinl):
Since DBF driver is obsolete in GRASS 7 and will be probably removed in
GRASS 8 I think that reported issue will not fixed. Could you suggest
changes in manual? Ideally as attached patch. Thanks.
#3396: db.in.ogr fails with .dbf files created with Visual Foxpro
--------------------------+-------------------------
Reporter: maitl | Owner: grass-dev@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: Database | Version: 7.2.1
Resolution: | Keywords:
CPU: Unspecified | Platform: MSWindows 7
--------------------------+-------------------------
Comment (by mlennert):
Replying to [ticket:3396 maitl]:
> Import of .dbf table created with Visual Foxpro ends with "ERROR: Input
DSN <C:\mytable.dbf> not found or not readable" . The problem is probably
related to the .dbf file header where file structure is described
(https://msdn.microsoft.com/en-us/library/aa975386(v=vs.71).aspx).
>
> When I converted the problematic table in Visual Foxpro environment to
Foxpro 2.x format (command COPY TO mytable_fox26x TYPE FOX2X), then
dbf.in.ogr works.
I cannot reproduce with GRASS 7.2.1 and GDAL 2.2.1:
I also don't think that this would be an issue with the GRASS GIS dbf
driver as db.in.ogr uses ogr to read the file. So if there is an issue it
is probably with your version of GDAL.
What do
ogrinfo table_VFP_import_fail.dbf
and
ogrinfo table_VFP_import_fail.dbf table_VFP_import_fail
#3396: db.in.ogr fails with .dbf files created with Visual Foxpro
--------------------------+-------------------------
Reporter: maitl | Owner: grass-dev@…
Type: defect | Status: new
Priority: minor | Milestone:
Component: Database | Version: 7.2.1
Resolution: | Keywords:
CPU: Unspecified | Platform: MSWindows 7
--------------------------+-------------------------
Comment (by maitl):
Ok, I see that both tables can be imported on a different machine.
I found several ogrinfo binaries from my machine.
{{{
# "C:\Program Files\GDAL\ogrinfo" --version
GDAL 1.11.1, released 2014/09/24
}}}
{{{
# "C:\Program Files\GRASS GIS 7.2.1\extrabin\ogrinfo" --version
GDAL 2.1.3, released 2017/20/01
}}}
{{{ #c:\osgeo4w\bin\ogrinfo --version
GDAL 1.11.2, released 2015/02/10
}}}
All can read the problematic table_VFP_import_fail.dbf and print the file
content with -sql switch.
The output from all these ogrinfo exemplars is attached
(ogrinfo_of_dbf_tables.zip) . There are differences on field types as
interpreted by different ogrinfo versions, but this is probably not
important.
The output of ogrinfo from problematic table contains additional rows
with
{{{
_NullFlags: String (2.0)
: String (0.0)
: String (0.0)
: String (0.0)
: String (0.0)
: String (0.0)
: String (0.0)
: String (0.0)
: String (0.0)
}}}