[GRASS-dev] db.join script wanted
Luca Delucchi
lucadeluge at gmail.com
Wed Mar 9 10:12:50 PST 2016
On 9 March 2016 at 18:56, Luca Delucchi <lucadeluge at gmail.com> wrote:
> On 9 March 2016 at 18:01, Markus Neteler <neteler at osgeo.org> wrote:
>> Hi
>>
>
> Hi,
>
>> I hope that another developer picks it up add I am traveling...
>>
>
> I'm working on it, but for me it doesn't work
>
> I'll update you
>
Ok, I was wrong it works, but there is a problem.
I'm not able to read the new columns. I try to explain you
I imported the two attached csv files (table1 without header and
table2 with header)
db.in.ogr input=/tmp/table1.csv output=table1
db.in.ogr input=/tmp/table2.csv output=table2
db.join table=table1 column=field_1 other_table=table2 other_column=id
db.select table=table1
WARNING: SQLite driver: unable to parse decltype: TEXT(1000)
WARNING: SQLite driver: unable to parse decltype: TEXT(1000)
WARNING: SQLite driver: unable to parse decltype: TEXT(1000)
WARNING: SQLite driver: column 'id', SQLite type 3 is not supported
WARNING: SQLite driver: unable to parse decltype: TEXT(1000)
WARNING: SQLite driver: column 'label', SQLite type 3 is not supported
field_1|field_2
1|100
2|100
3|200
4|100
5|200
6|100
7|200
8|200
9|100
10|100
but the table is correct in sqlite3
sqlite3 grassdata/gauss_boaga/lucadelu/sqlite/sqlite.db
SQLite version 3.10.2 2016-01-20 15:27:19
Enter ".help" for usage hints.
sqlite> select * from table1;
1|100|1|terra
2|100|2|mare
3|200|3|mare
4|100|4|terra
5|200|5|terra
6|100|6|mare
7|200|7|mare
8|200|8|terra
9|100|9|mare
10|100|10|terra
sqlite> .schema table1
CREATE TABLE table1(field_1 CHARACTER, field_2 CHARACTER, id
TEXT(1000), label TEXT(1000));
The problem is the different type of columns, I'll look on the code later
--
ciao
Luca
http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: table1.csv
Type: text/csv
Size: 61 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160309/fc621457/attachment.csv>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: table2.csv
Type: text/csv
Size: 85 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20160309/fc621457/attachment-0001.csv>
More information about the grass-dev
mailing list