[GRASS-user] Join sqlite table by coordinate pair (X,Y)

Johannes Radinger johannesradinger at gmail.com
Thu Oct 25 04:00:07 PDT 2012


Hi,

thank you for your enspiring answers. I think I'll stick to the direct
sqlite approach
instead of the v.distance.
There are now two tables in my sqlite database, one is connected to
the GRASS vector
 and the other is a table imported from a csv. For both tables I want
to join/merge I created a new column .
This new column contains a text-key (like "123.1232-3424.234"). These
text strings are identical in both
tables that's why I could use them as key.

As both tables have similarly approx. 130 000 rows I am not sure about
the fastest way
to join/merge/append 3 columns from on table to the GRASS vector table
using sqlite?

I tried your approach which took very long time (I stopped the process
after 45 min), thus
I interesting if there is a faster approach than:
> sqlite> UPDATE vector SET from_csv_col1=(SELECT c.col1 FROM csv_table AS c WHERE c.xy_key=vector.xy_key);

Is there any way to speed up such a join? As I am newbie to SQL/SQlite, any help
is much appreciated! Maybe this is more a question for a pure
Sqlite/SQL forum...

/johannes


More information about the grass-user mailing list