[GRASS-user] v.dissolve and r.cost problems

Markus Neteler neteler at osgeo.org
Thu Apr 2 07:43:36 EDT 2009


On Wed, Apr 1, 2009 at 6:05 PM, Paolo Cavallini <cavallini at faunalia.it> wrote:
> Hi all.
> I cannot get a result from v.dissolve:
>
> v.dissolve input=regiao at nuovo layer=1 column=REGIAO output=reg_diss
> dbmi: Protocol error
> Cannot open select cursor: SELECT cat, REGIAO FROM regiao ORDER BY REGIAO
> Unable to open vector map on topology level 2
> Table linked to vector map does not exist
> Vector map not found in current mapset
...
>  6.3.0.1-gfossit20090216-1

I got your data set and found:
GRASS 6.5.svn (portugal):~ > echo "SELECT cat, REGIAO FROM regiao
ORDER BY REGIAO" | db.select
dbmi: Protocol error

GRASS 6.5.svn (portugal):~ > echo "SELECT cat, REGIAO FROM regiao" | db.select
cat|REGIAO
1|NOROESTE CISMONTANO
2|ALTO PORTUGAL
3|ALTO PORTUGAL

but in db/driver/dbfexe.c I see

    /* Order */
    if (st->command == SQLP_SELECT && st->orderCol) {
        G_debug(3, "Order selection by %s", st->orderCol);

        /* Find order col */
        cur_cmp_ocol = -1;

which suggests to me that ORDER BY should be supported.
Not sure why it fails.

Quick solution for you: use the SQLite driver.

Looking at
"What's new in GRASS 6.3.0
    * Source code quality/libraries:
...
          o DBMI: SQL parser extended (support for DROP COLUMN,
ASC/DESC keyword in ORDER BY clause, etc.)

?

Markus


More information about the grass-user mailing list