Details Ticket 4286


Comment | Reply | Take | Resolve


Serial Number 4286
Subject r.cost and r.walk will not work with vector start points
Area grass6
Queue grass
Requestors michael.barton@asu.edu
Owner none
Status open
Last User Contact Tue Apr 18 16:55:20 2006 (2 yr ago)
Current Priority 70
Final Priority 70
Due No date assigned
Last Action Wed Apr 19 08:11:26 2006 (2 yr ago)
Created Thu Apr 13 08:32:26 2006 (2 yr ago)

Transaction History Ticket 4286


Thu, Apr 13 2006 08:32:26    Request created by guest  
Subject: r.cost will not work with vector start points

Ijust learned that r.cost still will not work with vector start points. It
generates an error if you use them. This has been the case for a long time and
I thought it was fixed until a student in my lab tried to use it yesterday.
Michael
Thu, Apr 13 2006 14:18:49    Mail sent by hamish_nospam@yahoo.com  
Return-Path <hamish_nospam@yahoo.com>
Delivered-To grass-bugs@lists.intevation.de
Date Fri, 14 Apr 2006 00:18:32 +1200
From Hamish <hamish_nospam@yahoo.com>
To Request Tracker <grass-bugs@intevation.de>
Cc grass5@grass.itc.it
Subject Re: [GRASS5] [bug #4286] (grass) r.cost will not work with vector start points
Message-Id <20060414001832.021a4baf.hamish_nospam@yahoo.com>
In-Reply-To <20060413063226.F0C311005B0@lists.intevation.de>
References <20060413063226.F0C311005B0@lists.intevation.de>
X-Mailer Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
X-Face M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
Mime-Version 1.0
Content-Type text/plain; charset=US-ASCII
Content-Transfer-Encoding 7bit
X-Spam-Status No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
X-Spam-Level
> I just learned that r.cost still will not work with vector start
> points. It generates an error if you use them. This has been the case
> for a long time and I thought it was fixed until a student in my lab
> tried to use it yesterday.


I tried this earlier today and to my surprise got a segfault. It still
needs an update from the sites lib to the vector lib. I used the
start_rast= option last week without any problems.

work around: (for a small number of starting points)
  COORDS=`v.out.ascii | cut -f1,2 -d'|' | tr '\n' ','`
  r.cost coordinate=$COORDS


Hamish


Thu, Apr 13 2006 16:32:43    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Thu, 13 Apr 2006 07:30:41 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [bug #4286] (grass) r.cost will not work with vector
In-reply-to <20060413121850.1445B1006B8@lists.intevation.de>
To Paolo Cavallini via RT <grass-bugs@intevation.de>
Message-id <C063AEA1.9A9D%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.3.060209
Thread-Topic [bug #4286] (grass) r.cost will not work with vector
Thread-Index AcZfBtcbFciBksr6EdqgLAAKlXAweg==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
I forgot to mention that this also affects r.walk.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Hamish via RT <grass-bugs@intevation.de>
> Reply-To: Hamish via RT <grass-bugs@intevation.de>
> Date: Thu, 13 Apr 2006 14:18:50 +0200 (CEST)
> To: <michael.barton@asu.edu>
> Subject: [bug #4286] (grass) r.cost will not work with vector
> 
>> I just learned that r.cost still will not work with vector start
>> points. It generates an error if you use them. This has been the case
>> for a long time and I thought it was fixed until a student in my lab
>> tried to use it yesterday.
> 
> 
> I tried this earlier today and to my surprise got a segfault. It still
> needs an update from the sites lib to the vector lib. I used the
> start_rast= option last week without any problems.
> 
> work around: (for a small number of starting points)
>   COORDS=`v.out.ascii | cut -f1,2 -d'|' | tr '\n' ','`
>   r.cost coordinate=$COORDS
> 
> 
> Hamish
> 
> 
> --- Headers Follow ---
> 
>> From hamish_nospam@yahoo.com  Thu Apr 13 14:18:49 2006
> Return-Path: <hamish_nospam@yahoo.com>
> Delivered-To: grass-bugs@lists.intevation.de
> Received: from mail.intevation.de (aktaia [212.95.126.10])
> by lists.intevation.de (Postfix) with ESMTP id A90EC1006B6
> for <grass-bugs@lists.intevation.de>; Thu, 13 Apr 2006 14:18:49 +0200 (CEST)
> Received: from localhost (localhost [127.0.0.1])
> by mail.intevation.de (Postfix) with ESMTP id 6391C36DC4
> for <grass-bugs@lists.intevation.de>; Thu, 13 Apr 2006 14:18:49 +0200 (CEST)
> Received: from mailhub1.otago.ac.nz (mailhub1.otago.ac.nz [139.80.64.218])
> by mail.intevation.de (Postfix) with ESMTP id CE14B36DB1
> for <grass-bugs@intevation.de>; Thu, 13 Apr 2006 14:18:47 +0200 (CEST)
> Received: from galadriel.otago.ac.nz (galadriel.otago.ac.nz [139.80.64.213])
> by mailhub1.otago.ac.nz (8.13.6/8.13.6) with ESMTP id k3DCIYGM001329;
> Fri, 14 Apr 2006 00:18:34 +1200
> Received: from taihua (taihua.otago.ac.nz [139.80.35.27])
> by galadriel.otago.ac.nz (8.12.8/8.12.8) with SMTP id k3DCIW91028437;
> Fri, 14 Apr 2006 00:18:33 +1200 (NZST)
> Date: Fri, 14 Apr 2006 00:18:32 +1200
> From: Hamish <hamish_nospam@yahoo.com>
> To: Request Tracker <grass-bugs@intevation.de>
> Cc: grass5@grass.itc.it
> Subject: Re: [GRASS5] [bug #4286] (grass) r.cost will not work with vector
>  start points
> Message-Id: <20060414001832.021a4baf.hamish_nospam@yahoo.com>
> In-Reply-To: <20060413063226.F0C311005B0@lists.intevation.de>
> References: <20060413063226.F0C311005B0@lists.intevation.de>
> X-Mailer: Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
> X-Face: 
> M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB
>  8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
> Mime-Version: 1.0
> Content-Type: text/plain; charset=US-ASCII
> Content-Transfer-Encoding: 7bit
> X-Spam-Status: No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00,
> FORGED_YAHOO_RCVD
> X-Spam-Level: 
> 
> -------------------------------------------- Managed by Request Tracker


Fri, Apr 14 2006 10:17:07    Subject changed to r.cost and r.walk will not work with vector start points by msieczka  
Tue, Apr 18 2006 05:35:42    Mail sent by hbowman  
r.cost segfaults with a vector point input map, but only if that input map has
attributes.

e.g. if you just make a points map:
echo "x|y" | v.in.ascii [-t]

it works ok.

Speafish example where it fails:
  r.cost in=elevation.dem out=tmp_segflt start_points=bugsites


problem:
r.cost/main.c line 472 doesn't allocate room for any attributes (the end ,0,0)
site = G_site_new_struct(-1, 2, 0, 0);

but the G_site_get() two lines later will try and copy any attributes into the
site structure. Result: segmentation fault on this line of lib/sites/sites.c
G_strncpy (s->str_att[i], sa->str[i], MAX_SITE_STRING);



a fix:
scan the sites and allocate enough memory.

a better fix:
update module to have it use the new vector API.



Hamish

ps - I've just done a cleanup on the r.cost help page, including a new figure
showing the effect of using the knight's move. Can anybody tell me if the
ending/starting text is reversed in the EXAMPLE section? (see html source
comments)
Tue, Apr 18 2006 16:55:20    Mail sent by mneteler  
Michael,

I have fixed r.cost (r.walk I had already fixed some days ago).
This now works:

r.cost in=elevation.dem out=tmp_segflt start_points=bugsites

r.walk elevation.dem out=tmp_segfltw start_points=bugsites friction=slope lambda=2
Please compare the results (r.walk differs significantly, it is hopefully
better)!

Markus
Tue, Apr 18 2006 17:52:10    Mail sent by michael.barton@asu.edu  
Return-Path <Michael.Barton@asu.edu>
Delivered-To grass-bugs@lists.intevation.de
Date Tue, 18 Apr 2006 08:49:33 -0700
From Michael Barton <michael.barton@asu.edu>
Subject Re: [bug #4286] (grass) r.cost and r.walk will not work with vector start points
In-reply-to <20060418145520.E42F51005A4@lists.intevation.de>
To Paolo Cavallini via RT <grass-bugs@intevation.de>
Cc Isaac Ullah <isaac.ullah@asu.edu>
Message-id <C06A589D.20AF3%michael.barton@asu.edu>
MIME-version 1.0
Content-type text/plain; charset=US-ASCII
Content-transfer-encoding 7bit
User-Agent Microsoft-Entourage/11.2.3.060209
Thread-Topic [bug #4286] (grass) r.cost and r.walk will not work with vector start points
Thread-Index AcZi/6+q7mil9s7yEdqa5AAUUSYxwg==
X-Spam-Status No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
X-Spam-Level
Thanks. We'll test.

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics and Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


> From: Markus Neteler via RT <grass-bugs@intevation.de>
> Reply-To: Markus Neteler via RT <grass-bugs@intevation.de>
> Date: Tue, 18 Apr 2006 16:55:20 +0200 (CEST)
> To: <michael.barton@asu.edu>
> Subject: [bug #4286] (grass) r.cost and r.walk will not work with vector start
> points
> 
> Michael,
> 
> 
> 
> I have fixed r.cost (r.walk I had already fixed some days ago).
> 
> This now works:
> 
> 
> 
> r.cost in=elevation.dem out=tmp_segflt start_points=bugsites
> 
> 
> 
> r.walk elevation.dem out=tmp_segfltw start_points=bugsites friction=slope
> lambda=2
> 
> 
> 
> Please compare the results (r.walk differs significantly, it is hopefully
> 
> better)!
> 
> 
> 
> Markus
> 
> -------------------------------------------- Managed by Request Tracker


Wed, Apr 19 2006 08:11:26    Comments added by hbowman  
r.drain updated (and fixed), which should be the last of 'em.


r.cost fixed in the 6.0.x branch as well. (only one in 6.0.x that had it AFAICT)
Hamish
Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request