[GRASS-user] v.dissolve and r.cost problems
Markus Neteler
neteler at osgeo.org
Thu Apr 2 10:00:30 EDT 2009
On Thu, Apr 2, 2009 at 1:43 PM, Markus Neteler <neteler at osgeo.org> wrote:
> 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.
Offlist we figured it out:
If the "REGIAO" column field value is empty, then it fails. Perhaps
only happening with char columns. Somewhere here:
http://trac.osgeo.org/grass/browser/grass/branches/releasebranch_6_4/db/drivers/dbf/dbfexe.c#L644
Any ideas why?
Markus
More information about the grass-user
mailing list