[GRASS5] V.to.db strange behavior

Radim Blazek blazek at itc.it
Mon Jan 3 04:00:09 EST 2005


Michael Barton wrote:
> I've messed with v.to.db a bit more and am getting very strange results. I
> admit that I might not be putting in correct values (though I'm trying to
> follow the example). But v.to.db is putting in values that I am not. Below
> is an example.
> 
> v.to.db map=subsector type=point,line,boundary,centroid layer=1 qlayer=1
> option=query column=survey qcolumn=count(*) -p
> Reading data trom the map ...
> 
> Querying database ...
> DBMI-DBF driver error:
> SQL parser error in statement:
> SELECT count(*) FROM subsector WHERE cat = 28
> Error in db_open_select_cursor()
> 
> 
> Cannot open cursor: 'SELECT count(*) FROM subsector WHERE cat = 28'
> 
> 
> So where is the clause 'WHERE cat=28' coming from????? I certainly didn't
> specify that. How can I actually make a query?

The count() is not supported by dbf driver.

With option=query, you can make a query for attributes of one layer and 
upload results to attribute table of another layer. layer = qlayer does 
not make sense. For example, if you have a map of overlapping areas 
(e.g. fires of forest) as layer 1, you can add a new layer 2 and count 
for each area number of fires.

Radim




More information about the grass-dev mailing list