On 26/02/2019 23:37, Rich Shepard wrote:
Current map displayed is Pit_Lakes@pit_lakes. I want to export the 42 rows
in the table and followed the example on the manual page:

GRASS 7.7.svn:~/data/grassdata/Nevada/BMRR > db.out.ogr in=Pit_Lakes
out=pit_lakes.csv
ERROR: File <Pit_Lakes.dbf> already exists

I am not seeing what error I made and would appreciate being shown what I've
done incorrectly.


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.  I can only guess that this unusual test was implemented to avoid overwriting the *.dbf component of a shapefile. That is, when saving an attribute table to a dbf file, if there was a shapefile with the same name, then it's dbf component would get changed, corrupting the whole shapefile. I think this could be done more simply. (I'll suggest a PR)


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.


Regards,

Micha



TIA,

Rich
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
-- 
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to