[GRASS-dev] d.nviz problem or question

Glynn Clements glynn at gclements.plus.com
Tue Aug 14 11:47:42 EDT 2007


Michael Barton wrote:

> I've pretty much finished a TclTk wrapper for d.nviz. Now I've encountered a
> problem running it. In order to do this, I need to use TclTk to grab
> coordinate points (x,y pairs) for the route that d.nviz will use. These
> should go into the route= option. d.nviz is then run non-interactively to
> generate the script for NVIZ.
> 
> However, when I try to run  d.nviz with coordinate points, rather than
> running it interactively, I get the following errors. Note that this was run
> with the Spearfish elevation.dem raster with the region set to the map. The
> coordinate points ARE within the map region. I tried this with a much
> smaller layback distance and had the same result.
> 
> GRASS 6.3.cvs (spearfish60_test):~ > d.nviz  input=elevation.dem at PERMANENT
> output=fly2  name=NVIZ
> route=594890.607477,4915842.85047,598114.766355,4920072.71028,601368.504673,
> 4922882.75701,604770.140187,4925397.00935  dist=2000  ht=1000  frames=100
> start=0
> WARNING: Skipping this point, selected point is outside region. Perhaps the
>          camera setback distance puts it beyond the edge?
> WARNING: Skipping this point, selected point is outside region. Perhaps the
>          camera setback distance puts it beyond the edge?
> WARNING: Skipping this point, selected point is outside region. Perhaps the
>          camera setback distance puts it beyond the edge?
> WARNING: Skipping this point, selected point is outside region. Perhaps the
>          camera setback distance puts it beyond the edge?
> WARNING: Skipping this point, selected point is outside region. Perhaps the
>          camera setback distance puts it beyond the edge?
> WARNING: Skipping this point, selected point is outside region. Perhaps the
>          camera setback distance puts it beyond the edge?
> d.nviz complete. Created NVIZ script <fly2.nvscr>.
> 
> The script produced does nothing because there are no coordinate points. If
> I do this interactively in an xterm, it works fine with exactly the same
> parameters.
> 
> Any suggestions?

read_rast() is using D_u_to_a_{row,col}(), but the transformation
parameters only get initialised (using D_setup()) if -i is given.

I suggest the following addition:

--- display/d.nviz/main.c	21 Nov 2006 23:06:31 -0000	2.9
+++ display/d.nviz/main.c	14 Aug 2007 15:46:03 -0000
@@ -156,6 +156,8 @@
 /* get GRASS parameters */
     G_get_window(&window);
     projection = G_projection();
+    D_do_conversions(&window, 0, 1, 0, 1);
+
 /* setup screen coords */
     screen_x = ((int) D_get_d_west() + (int) D_get_d_east()) / 2;
     screen_y = ((int) D_get_d_north() + (int) D_get_d_south()) / 2;

The screen coordinates don't matter for the u<->a conversions. If -i
is given, D_setup() will override this with the actual frame
boundaries.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list