[GRASS-user] db.out.ogr: not exporting rows

Rich Shepard rshepard at appl-ecosys.com
Wed Feb 27 05:46:27 PST 2019


On Wed, 27 Feb 2019, Micha Silver wrote:

> Looking at the source code for db.out.ogr, I see that this module has a
> somewhat strange approach to checking for the overwrite flag. There is a
> test for existence of a file with the same name as the GRASS *input*
> layer, but with .dbf extension. If such a file exists, the module fails,
> as you saw. 

Micha,

Wow! It would never have occurred to me that --o was needed! Because
v.out.ogr is supposed to have a .dbf for input (as the default), and the
output was specified as .csv there could not be any overwritten file.
Besides, the purpose of the module is to _export_ rows from the database
file, not overwrite the table.

>From your detailed look at the source code I suggest a clean up that would
prevent the output file having the same extension as the input file (despite
that making no sense at all) and letting the rest work as expected.

> In your case, you could get around the issue by simply adding the
> overwrite flag to your command. Since you're saving to a *.csv, there's no
> danger of overwriting any existing dbf.

Yes, I'll do this. Thanks very much for taking the time to find this quirk.

Best regards,

Rich


More information about the grass-user mailing list