<div dir="ltr"><div><div><br><br>On Wed, May 23, 2018 at 12:41 PM, Moritz Lennert <<a href="mailto:mlennert@club.worldonline.be">mlennert@club.worldonline.be</a>> wrote:<br>><br>><br>><br>> Am 23. Mai 2018 12:23:45 MESZ schrieb Stefan Blumentrath <<a href="mailto:Stefan.Blumentrath@nina.no">Stefan.Blumentrath@nina.no</a>>:<br>> >Ciao Vero,<br>> ><br>> >Unfortunately, it seems you have to create a new table with desired<br>> >column order, copy data into it (INSERT INTO FROM SELECT) and then link<br>> >the new table to your vector map (v.db.connect)…:<br>> ><a href="https://stackoverflow.com/questions/20574113/sqlite3-how-to-reorder-columns-in-a-table">https://stackoverflow.com/questions/20574113/sqlite3-how-to-reorder-columns-in-a-table</a><br>><br>> Personally I would consider this as a bug. v.patch should match columns by names<br>and type<br>> not order. But I haven't looked at the code yet to understand what this would entail.<br><br></div>in theory this (ignore order, check name+type match) is easy to implement. Please open a ticket.<br><br></div>Markus M<br><div><div>><br>> Moritz<br>><br>><br>> ><br>> >Note that SQLite will launder column names to lower case if you don`t<br>> >quote them. Then they may not match even if in proper order<br>> >(speculating here)…<br>> ><br>> >Cheers<br>> >Stefan<br>> ><br>> >From: grass-user <<a href="mailto:grass-user-bounces@lists.osgeo.org">grass-user-bounces@lists.osgeo.org</a>> On Behalf Of<br>> >Veronica Andreo<br>> >Sent: onsdag 23. mai 2018 12.12<br>> >To: grass-user <<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>><br>> >Subject: [GRASS-user] reorder columns in vector attribute table<br>> ><br>> >Hi all,<br>> ><br>> >I want to use v.patch -e to patch geometries and attributes of polygon<br>> >maps belonging to different states in Australia and the column names in<br>> >the attr tables are the same (they only vary in the order in which they<br>> >are) but when making an attempt, I get:<br>> ><br>> >v.patch -e input=act_bushfire_2012_2017,tas_bushfire_2012_2017<br>> >output=test<br>> >ERROR: Column names differ<br>> ><br>> >Column names here:<br>> ><br>> >v.db.select tas_bushfire_2012_2017 | head<br>> >cat|FIRE_TYPE|OBJECTID|START_DATE|END_DATE|STATE|AREA_ha|PERIMETER_km<br>> ><br>> >v.db.select act_bushfire_2012_2017<br>> >cat|OBJECTID|FIRE_TYPE|START_DATE|END_DATE|STATE|AREA_ha|PERIMETER_km<br>> ><br>> >only OBJECTID and FIRE_TYPE are shifted.<br>> ><br>> >Is there an easy way to reorder columns in the attribute table of a<br>> >vector map?? I thought v.patch would match column names in the attr<br>> >table...<br>> ><br>> >Thanks much in advance,<br>> >Vero<br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user">https://lists.osgeo.org/mailman/listinfo/grass-user</a><br><br></div></div></div>