[GRASS-dev] [bug #2793] (grass) where v.segment creates the p oints

Patton, Eric epatton at nrcan.gc.ca
Mon Oct 9 21:35:17 EDT 2006


Maciek,

I was trying to figure out more about what is going on with this bug as
well. The side offset gets read from stdin, but never gets used in the
creation of a new line:

while ( fgets (buf, sizeof(buf), stdin) != NULL ) {
	G_debug ( 2, "SEGMENT: %s", G_chop(buf));
	side_offset = 0;
	Vect_reset_line ( SPoints );
	Vect_reset_cats ( SCats );
	switch ( buf[0] ) {
	    case 'P':
		side_offset = 0;
		ret = sscanf ( buf, "%c %d %d %lf %lf", &stype, &id, &lcat,
&offset1, &side_offset);  
                */ OK, side offset has been read */
        
		if ( ret < 4 ) { 
		    G_warning ( "Cannot read input: %s", buf);
		    break;
		}
		points_read++;
		G_debug (2, "point: %d %d %f %f", id, lcat, offset1,
side_offset);
		
		
		/* OK, write point */
                line = find_line ( &In, lfield, lcat );
		if ( line == 0 ) {
		    G_warning ( "Cannot find line of cat %d", lcat);
		    break;
		}

	        Vect_read_line ( &In, LPoints, LCats, line );
		ret = Vect_point_on_line ( LPoints, offset1, &x, &y, &z,
&angle, NULL);
              
                /* Should Vect_point_on_line be passed the side offset here?
*/


                if ( ret == 0 ) {
		    len = Vect_line_length ( LPoints );
		    G_warning ( "Cannot get point on line: cat = %d offset =
%f (line length = %f)\n%s",
			         lcat, offset1, len, buf);
		    break;
		}

                Vect_append_point ( SPoints, x, y, z );
		Vect_cat_set ( SCats, 1, id );

		Vect_write_line ( &Out, GV_POINT, SPoints, SCats);
		points_written++;
		break; 


I thought I might try to follow the program logic to see if anything obvious
was weird, but I'm way out of my league here. Vect_point_on_line is fed
offset1, but not the side_offset; instead, it reads x, y, z and angle, but I
don't know where these come from, or how they're calculated (?). 

~ Eric.


-----Original Message-----
From: grass-dev-bounces at grass.itc.it
Cc: grass-dev at grass.itc.it
Sent: 10/8/2006 7:10 PM
Subject: [GRASS-dev] [bug #2793] (grass) where v.segment creates the points

this bug's URL: http://intevation.de/rt/webrt?serial_num=2793

Request number 2793 was commented on by 'msieczka' (Maciek Sieczka). 
Responding to this message will send mail to the requestor.
			
			Request Tracker
			rt at intevation.de

--------------------------------------------------------------
Cc: grass-dev at grass.itc.it

I have used v.segment in the last days and I'm sure there is a bug in
the side
offset, at least for point mode. The bug is that the offset doesn't
work, it
is always 0.

Folks have been reporting this:

http://grass.itc.it/pipermail/grassuser/2005-December/031522.html
http://www.nabble.com/-GRASS-user--HEC-RAS-tf2066275.html#a5691777
http://www.nabble.com/-GRASS-user--v.segment---how-to-use-orthogonal-off
set--tf2065644.html#a5691131

Maciek



-------------------------------------------- Managed by Request Tracker

_______________________________________________
grass-dev mailing list
grass-dev at grass.itc.it
http://grass.itc.it/mailman/listinfo/grass-dev




More information about the grass-dev mailing list