<html style="direction: ltr;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">body p { margin-bottom: 0cm; margin-top: 0pt; } </style>
</head>
<body bidimailui-charset-is-forced="true" style="direction: ltr;"
text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 26/02/2019 23:37, Rich Shepard
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:alpine.LNX.2.20.1902261333370.16864@salmo.appl-ecosys.com">Current
map displayed is Pit_Lakes@pit_lakes. I want to export the 42 rows
<br>
in the table and followed the example on the manual page:
<br>
<br>
GRASS 7.7.svn:~/data/grassdata/Nevada/BMRR > db.out.ogr
in=Pit_Lakes
<br>
out=pit_lakes.csv
<br>
ERROR: File <Pit_Lakes.dbf> already exists
<br>
<br>
I am not seeing what error I made and would appreciate being shown
what I've
<br>
done incorrectly.
<br>
</blockquote>
<p><br>
</p>
<p>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)</p>
<p><br>
</p>
<p>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.</p>
<p><br>
</p>
<p> </p>
<p>Regards,</p>
<p>Micha<br>
</p>
<p> <br>
</p>
<blockquote type="cite"
cite="mid:alpine.LNX.2.20.1902261333370.16864@salmo.appl-ecosys.com">
<br>
TIA,
<br>
<br>
Rich
<br>
_______________________________________________
<br>
grass-user mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote>
<pre class="moz-signature" cols="72">--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918</pre>
</body>
</html>