[GRASS-dev] [GRASS GIS] #3396: db.in.ogr fails with .dbf files created with Visual Foxpro
GRASS GIS
trac at osgeo.org
Fri Aug 11 02:20:38 PDT 2017
#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:
{{{
> db.in.ogr table_VFP_import_fail.dbf out=test
Imported table <test> with 5 rows
> db.in.ogr table_FOX2x_import_ok.dbf out=test2
Imported table <test2> with 5 rows
> db.select table=test
X|Y|PE|ME_MREG|M1HB|M1KU|M1KS|M1LV|M1LM|M1MA|M1TL|M2|JRK|MID|xNullFlags
373094|6464908|13|47|0|0|0|0|0|47|0|0|150818|483611848311|
374195|6462403|11|230|23|12|115|0|0|80|0|0|150818|1345853648111|
374489|6464662|13|184|0|0|4|0|0|180|0|0|270634|907614648111|
375069|6463314|13|182|0|0|0|0|0|182|0|0|150818|483611048311|
375288|6472475|13|103|0|0|0|0|0|103|0|0|270634|1016537148111|
> db.select table=test2
X|Y|PE|ME_MREG|M1HB|M1KU|M1KS|M1LV|M1LM|M1MA|M1TL|M2|JRK|MID
373094|6464908|13|47|0|0|0|0|0|47|0|0|150818|483611848311
374195|6462403|11|230|23|12|115|0|0|80|0|0|150818|1345853648111
374489|6464662|13|184|0|0|4|0|0|180|0|0|270634|907614648111
375069|6463314|13|182|0|0|0|0|0|182|0|0|150818|483611048311
375288|6472475|13|103|0|0|0|0|0|103|0|0|270634|1016537148111
}}}
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
give you ?
What version of GDAL do you have installed.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3396#comment:2>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list