[GRASS-dev] About v.distance, v.what.vect (wrt "count points
mlennert at club.worldonline.be
Thu Aug 12 10:50:38 EDT 2010
On 12/08/10 12:40, Nikos Alexandris wrote:
> time v.what.vect --v vector=pareto_ref_points___pareto_ref_30m
> column=gridcell_1 qcolumn=cat
> Now this is crawling and I am waiting [*]. Didn't wanna let you waiting too
> long to know that this keeps me waiting - so I've hit the Send button :-p
Found the culprit !
Actually the problem is in v.db.dropcol which for the SQLite driver also
drops all indices (it creates a new table without the dropped column and
populates with a select from the old table). This means that there is no
index on the cat column which makes v.distance really slow.
I'm not sure about indices in the dbf driver, but would think that there
So, a quick solution for you would be to recreate the index after the
v.db.dropcol (all this is happening in your pareto_1 script):
echo "CREATE UNIQUE INDEX any_name_for_index on yourtable ( cat )" |
(don't know how to do this in a python script...)
Another (dirty) solution is to copy your map after the v.db.dropcol:
This automatically creates the index in test, and so
time v.what.vect --v vector=test
should be fast again...
I don't have time right now, but I'll look into adding the index
creation into v.db.dropcol, if you confirm that this is the problem.
More information about the grass-dev