<div dir="ltr"><div>Michael,</div><div><br></div><div>Just confirmed your issue.</div><div><br></div><div>v.random tmp100 npoints=100 seed=100<br>v.db.addtable tmp100 col="id varchar(20)"<br>v.db.update tmp100 col=id qcol="'tmp100_' || cat"<br><br>v.random tmp10 npoints=10 seed=10<br>v.db.addtable tmp10 col="id varchar(20)"<br>v.db.update tmp10 col=id qcol="'tmp10_' || cat"<br><br>v.patch tmp100,tmp10 out=tmp110 -e</div><div><br></div><div>v.category tmp110 op=report<br>Layer/table: 1/tmp110<br>type       count        min        max<br>point        110          2        112<br>line           0          0          0<br>boundary       0          0          0<br>centroid       0          0          0<br>area           0          0          0<br>face           0          0          0<br>kernel         0          0          0<br>all          110          2        112</div><div><br></div><div>In my case, all features in tmp10 are linked in tmp110.</div><div><br></div><div>You can recategorize it.</div><div></div><div><br></div><div>v.category tmp110 out=tmp110_nocats op=del cat=-1<br>v.category tmp110_nocats out=tmp110_recats op=add<br><br>npnts100=$(<a href="http://v.info">v.info</a> tmp100 -t | sed '/points=/!d; s/points=//')<br>npnts10=$(<a href="http://v.info">v.info</a> tmp10 -t | sed '/points=/!d; s/points=//')<br><br>v.db.update tmp110_recats col=cat qcol=cat-1 where="cat<=$npnts100+1"<br>v.db.update tmp110_recats col=cat qcol=cat-2 where="cat>$npnts100+1"</div><div><br></div><div>Yeah... I know what you may think... Please create an issue on GitHub.<br></div><div><br></div><div>Regards,<br></div><div>Huidae<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 14, 2024 at 4:42 PM Michael Barton via grass-dev <<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
Thanks Doug and Vincent. 
<div><br>
</div>
<div>None of this works. I vaguely remember having this same kind of road block several years back. </div>
<div><br>
</div>
<div>Nothing in v.category lets you change an existing cat value to a different value</div>
<div>v.in.ogr MUST add a column that MUST be named cat (all else causes an error--this is a bug) that is a series of consecutive integers from 1-n. So I cannot create a file with a cat field that matches my vector areas. </div>
<div><br>
</div>
<div>v.edit won't let you change an existing cat number AFAICT. No error but nothing changes. </div>
<div><br>
</div>
<div>Once I've imported a table using v.in.ogr, I cannot use db.drop.column to delete the cat column--even if it is not being used as a key field. This raises an error.</div>
<div><br>
</div>
<div>No way to rename a column from cat to something else (or something else to cat) unless you've already connected it to a vector map even if cat is not the key field. So I can't create an integer column to link up my lost vector area with a record in my
 csv file. </div>
<div><br>
</div>
<div>This simple task is just not possible in GRASS AFAICT. Or if it is possible, it can only be done by such non-obvious and convoluted means that I've yet to find a method that works in spite of asking a large number of very skilled GRASS users.</div>
<div><br>
</div>
<div>Michael</div>
<div>
<div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-indent:0px">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div style="overflow-wrap: break-word;">
<font>
<div style="letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal">
<font color="#929292" face="Calibri" style="font-style:normal;font-size:11px">_____________________________</font></div>
<div style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal">
<p style="margin-bottom:0in"><font color="#929292" face="Calibri" style="font-style:normal;font-size:11px"><font><span>C. Michael Barton<br>
Associate Director, School of Complex Adaptive Systems (</span></font><a href="https://scas.asu.edu/" target="_blank">https://scas.asu.edu</a><font><span>)<br>
Professor, School of Human Evolution & Social Change (<a href="https://shesc.asu.edu" target="_blank">https://shesc.asu.edu</a>)<br>
Director, Center for Social Dynamics & Complexity (<a href="https://complexity.asu.edu" target="_blank">https://complexity.asu.edu</a>)<br>
Arizona State University<br>
Tempe, AZ 85287-2701<br>
USA<br>
<br>
Executive Director, Open Modeling Foundation (</span></font><a href="https://openmodelingfoundation.github.io/" target="_blank">https://openmodelingfoundation.github.io</a><font><span>)<br>
Director, Network for Computational Modeling in Social & Ecological Sciences (<a href="https://comses.net" target="_blank">https://comses.net</a>)<br>
<br>
personal website: <a href="http://www.public.asu.edu/~cmbarton" target="_blank">http://www.public.asu.edu/~cmbarton</a> <br>
</span></font></font><br>
</p>
</div>
</font></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div><br>
<blockquote type="cite">
<div>On Mar 14, 2024, at 7:10 AM, Newcomb, Doug <<a href="mailto:doug_newcomb@fws.gov" target="_blank">doug_newcomb@fws.gov</a>> wrote:</div>
<br>
<div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
Have you tried a .csvt file for your .csv file?<span> </span><a href="https://urldefense.com/v3/__https://gdal.org/drivers/vector/csv.html__;!!IKRxdwAv5BmarQ!dv7XjZX6-VnNpFbpXP6R1XYWkuaA4Y-gDR4RvL3bWazWUkLfURuKDMWqiBFqBS6jlNSHDKZCo02GJKjauaAJ-pCVIKD5JDc$" id="m_3727611336902213894LPlnk964388" target="_blank">https://gdal.org/drivers/vector/csv.html</a></div>
<div style="font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt">
<br>
</div>
<div id="m_3727611336902213894appendonsend" style="font-family:Perpetua;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
</div>
<hr style="font-family:Perpetua;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;display:inline-block;width:766.359px">
<span style="font-family:Perpetua;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline"></span>
<div id="m_3727611336902213894divRplyFwdMsg" dir="ltr" style="font-family:Perpetua;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<font face="Calibri, sans-serif" style="font-size:11pt"><b>From:</b><span> </span>grass-dev <<a href="mailto:grass-dev-bounces@lists.osgeo.org" target="_blank">grass-dev-bounces@lists.osgeo.org</a>> on behalf of Michael Barton via grass-dev
 <<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a>><br>
<b>Sent:</b><span> </span>Wednesday, March 13, 2024 7:02 PM<br>
<b>To:</b><span> </span>GRASS developers <<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a>>; GRASS user list <<a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a>><br>
<b>Subject:</b><span> </span>[EXTERNAL] [GRASS-dev] vector patching frustration</font>
<div> </div>
</div>
<div style="font-family:Perpetua;font-size:18px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<p style="margin-top:0px;margin-bottom:0px"> </p>
<div>
<table border="2" cellspacing="4" cellpadding="0" style="border-color:black;background-color:yellow;margin-left:auto;margin-right:auto">
<tbody>
<tr>
<td>
<div style="margin-top:0px;margin-bottom:0px;text-align:center"><strong> This email has been received from outside of DOI - Use caution before clicking on links, opening attachments, or responding.  </strong></div>
</td>
</tr>
</tbody>
</table>
</div>
<div style="margin-top:0px;margin-bottom:0px"><br>
<br>
</div>
<div>I am completely stymied in my attempt to do what should be a simple task. I have a map of vector areas, linked with an attribute table. I would like to patch in one more vector area, for which I have equivalent attribute information. I have tried this
 multiple ways and I cannot make this patch happen so that the added area has attribute info. 
<div><br>
</div>
<div>The closest I've come is to create and link a one line table to the new area that has exactly the same fields as the larger vector area map. The first map has 154 areas (i.e., cat=1-155). When I patch the maps and look at the resulting attribute table,
 I indeed see line and cat 155. But it is not linked with the patched area--which has been assigned a cat=183 for reasons I cannot fathom. The patch also renumbers my cat field to cat=2-155 from the original 1-154. </div>
<div><br>
</div>
<div>This has been made more complicated by the fact that v.in.ogr imports all columns of a *.csv as text, regardless of what is in them and assigns cat numbers starting at 1. So I can't specify an integer key field of 155 to try the linking. Nor can I change
 the assigned cat of the single area I am trying to patch from 1 to 155 using v.category (or anything else I can find). </div>
<div><br>
</div>
<div>I'm hoping that someone has a clever solution that I've not seen or I'll just have to do this fairly simple and straightforward vector operation in QGIS. </div>
<div><br>
</div>
<div>Michael<br>
<div>
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div dir="auto" style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-align:start;text-indent:0px">
<div style="text-indent:0px">
<span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><span style="border-collapse:separate;text-indent:0px;border-spacing:0px">
<div><font>
<div style="letter-spacing:normal;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal">
<font color="#929292" face="Calibri" style="font-style:normal;font-size:11px">_____________________________</font></div>
<div style="font-variant-ligatures:normal;font-variant-east-asian:normal;line-height:normal">
<div style="margin-top:0px;margin-bottom:0in"><font color="#929292" face="Calibri" style="font-style:normal;font-size:11px"><font><span>C. Michael Barton<br>
Associate Director, School of Complex Adaptive Systems (</span></font><a href="https://scas.asu.edu/" target="_blank">https://scas.asu.edu</a><font><span>)<br>
Professor, School of Human Evolution & Social Change (<a href="https://shesc.asu.edu/" target="_blank">https://shesc.asu.edu</a>)<br>
Director, Center for Social Dynamics & Complexity (<a href="https://complexity.asu.edu/" target="_blank">https://complexity.asu.edu</a>)<br>
Arizona State University<br>
Tempe, AZ 85287-2701<br>
USA<br>
<br>
Executive Director, Open Modeling Foundation (</span></font><a href="https://urldefense.com/v3/__https://openmodelingfoundation.github.io/__;!!IKRxdwAv5BmarQ!dv7XjZX6-VnNpFbpXP6R1XYWkuaA4Y-gDR4RvL3bWazWUkLfURuKDMWqiBFqBS6jlNSHDKZCo02GJKjauaAJ-pCVvuAToIA$" target="_blank">https://openmodelingfoundation.github.io</a><font><span>)<br>
Director, Network for Computational Modeling in Social & Ecological Sciences (<a href="https://urldefense.com/v3/__https://comses.net/__;!!IKRxdwAv5BmarQ!dv7XjZX6-VnNpFbpXP6R1XYWkuaA4Y-gDR4RvL3bWazWUkLfURuKDMWqiBFqBS6jlNSHDKZCo02GJKjauaAJ-pCVdW6V-z8$" target="_blank">https://comses.net</a>)<br>
<br>
personal website: <a href="http://www.public.asu.edu/~cmbarton" target="_blank">http://www.public.asu.edu/~cmbarton</a></span></font></font></div>
</div>
</font></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>

_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-dev</a><br>
</blockquote></div><br clear="all"><br><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span><div><div dir="ltr">Huidae Cho, Ph.D., GISP, /<a href="http://ipa-reader.xyz/?text=hid%C9%9B" target="_blank">hidɛ</a> t͡ɕo/, 조희대, 曺喜大</div><div dir="ltr">GRASS GIS Developer</div><div><a href="https://idea.isnew.info/" target="_blank">https://idea.isnew.info/</a><br></div></div></span></div></div></div></div></div></div></div></div></div></div>