[GRASS-user] m.viz.image Command Line

Martin,

   I see that you're the lead author of m.nviz.image so you're probably the
best qualified to teach me the appropriate command line syntax to achieve
what I need for a project. I've read the man page and tried filling in the
data entry widgets in the wxGUI but keep running into errors I don't know
how to resolve.

   What I need is a 3D-perspective view of a portion of a drainage basin. It
would be nice to have the z-values increased 2 times to make the topography
easier to see.

   There are 2 raster maps: aber5m is the DEM/elevation map, and mompano_rast
is a raster version of the lakes vector map (because an area map will not
display in the wxGUI in 3D mode). There are also 2 vector maps to drape over
the rasters: streets (line color black, line width 1) and streams (line
color blue, line width 2) and a points map (proj_pts; color/fill color red,
icon diamond, size 8 in regular 3D view; no idea of the appropriate size in
m.nviz.image).

   There are many options for the command line and I have no idea which to
use or for which the above rasters, vectors, and points are the appropriate
maps.

   I'd greatly appreciate guidance on producing an output map given these 5
input maps.

Regards,

Rich

--
Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc. | Helping Ensure Our Clients' Futures
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

On Tue, Jan 17, 2012 at 3:11 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

Martin,

I see that you're the lead author of m.nviz.image so you're probably the
best qualified to teach me the appropriate command line syntax to achieve
what I need for a project. I've read the man page and tried filling in the
data entry widgets in the wxGUI but keep running into errors I don't know
how to resolve.

What I need is a 3D-perspective view of a portion of a drainage basin. It
would be nice to have the z-values increased 2 times to make the topography
easier to see.

There are 2 raster maps: aber5m is the DEM/elevation map, and mompano_rast
is a raster version of the lakes vector map (because an area map will not
display in the wxGUI in 3D mode). There are also 2 vector maps to drape over
the rasters: streets (line color black, line width 1) and streams (line
color blue, line width 2) and a points map (proj_pts; color/fill color red,
icon diamond, size 8 in regular 3D view; no idea of the appropriate size in
m.nviz.image).

There are many options for the command line and I have no idea which to
use or for which the above rasters, vectors, and points are the appropriate
maps.

I'd greatly appreciate guidance on producing an output map given these 5
input maps.

Hi,

try something like this:

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2

point size is in map units I think.

Anna

Regards,

Rich

--
Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc. | Helping Ensure Our Clients' Futures
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

try something like this:

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2

point size is in map units I think.

Anna,

   That's close, but missing elevation_values (and it needs an output map
name):

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2 output=foo

ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
        2: <mode> 1)

   When I read the man page I had no idea what to use for elevation_value;
still not certain that I do. But, based on Hamish's comment I think it's the
same two raster maps ... Nope. That's not it.

   How do I specify elevation_value?

Thanks,

Rich

--
Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc. | Helping Ensure Our Clients' Futures
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863

On Tue, Jan 17, 2012 at 3:48 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

try something like this:

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2

point size is in map units I think.

Anna,

That's close, but missing elevation_values (and it needs an output map
name):

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2 output=foo

ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
2: <mode> 1)

When I read the man page I had no idea what to use for elevation_value;
still not certain that I do. But, based on Hamish's comment I think it's the
same two raster maps ... Nope. That's not it.

How do I specify elevation_value?

elevation_value is to create plane of given value (this usaually means
height), I don't know if this is what you want. The error is in
specifying mode (fine, course) which doesn't match the number of
raster maps. Try

m.nviz.image -a ... to set the same mode (default is fine
resolution) for all raster maps or e.g.
m.nviz.image mode=fine,fine ...

Try it again and we will see

Anna

Thanks,

Rich

--
Richard B. Shepard, Ph.D. | Integrity - Credibility - Innovation
Applied Ecosystem Services, Inc. | Helping Ensure Our Clients' Futures
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi,

2012/1/17 Rich Shepard <rshepard@appl-ecosys.com>:

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2

m.nviz.image elevation_map=aber5m,mompano_rast vline=streets,streams
vline_width=1,2 vline_color=black,blue vpoint=proj_pts vpoint_size=8
vpoint_color=red vpoint_marker=diamond zexag=2 output=foo

ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
2: <mode> 1)

When I read the man page I had no idea what to use for elevation_value;
still not certain that I do. But, based on Hamish's comment I think it's the
same two raster maps ... Nope. That's not it.

How do I specify elevation_value?

you don't need to specify `elevation_value`. This parameter defines
constant plane surfaces (with fixed height). You need to specify other
surface-related parameters with given number of options. Eg.

m.nviz.image elevation_map=elevation,roadsmajor out=elev
mode=fine,fine resolution_fine=6,6 resolution_coarse=9,9
style=surface,surface shading=gouraud,gouraud
wire_color=136:136:136,136:136:136

This behaviour should be changed. If you do not define multiple values
for given parameters (like `wire_color`) then the module should use
default (single) value for all loaded surfaces.

Martin
--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

2012/1/17 Martin Landa <landa.martin@gmail.com>:

This behaviour should be changed. If you do not define multiple values
for given parameters (like `wire_color`) then the module should use
default (single) value for all loaded surfaces.

ops, I overlooked (`-a` flag) see Anna's answer.

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

Hi,

2012/1/17 Martin Landa <landa.martin@gmail.com>:

2012/1/17 Martin Landa <landa.martin@gmail.com>:

This behaviour should be changed. If you do not define multiple values
for given parameters (like `wire_color`) then the module should use
default (single) value for all loaded surfaces.

ops, I overlooked (`-a` flag) see Anna's answer.

btw, I have fixed a bug related to this flag in r50239.

Probably we would not need this flag. From user point of view it would
be probably more understandable eg.

m.nviz.image elevation_map=elevation,roadsmajor out=elev mode=fine,coarse

would render the first surface in `fine` mode, second in `coarse`
mode. The rest of surface-related options (like `resolution_fine`)
would be used for both surfaces.

Make sense to you?

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

Try

m.nviz.image -a ... to set the same mode (default is fine
resolution) for all raster maps or e.g.
m.nviz.image mode=fine,fine ...

Try it again and we will see

Anna,

   With the `-a' option I see:

ERROR: Inconsistent number of attributes (<vline> 2: <vline_mode> 1)

Without it (but with `mode=fine,fine':

ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
        2: <resolution_fine> 1

Rich

On Tue, 17 Jan 2012, Martin Landa wrote:

you don't need to specify `elevation_value`. This parameter defines
constant plane surfaces (with fixed height). You need to specify other
surface-related parameters with given number of options. Eg.

m.nviz.image elevation_map=elevation,roadsmajor out=elev
mode=fine,fine resolution_fine=6,6 resolution_coarse=9,9
style=surface,surface shading=gouraud,gouraud
wire_color=136:136:136,136:136:136

Martin,

   It's a good idea to get this working one part at a time. So I copied the
above into a shell script and changed the elevation_map names to the
specific ones I need to use. I'm still getting the same error:

   Script:

m.nviz.image elevation_map=aber5m,mompano_rast out=elev
mode=fine,fine resolution_fine=6,6 resolution_coarse=9,9
style=surface,surface shading=gouraud,gouraud
wire_color=136:136:136,136:136:136

produces,

GRASS 6.5.svn (Oregon):~/grassdata/Oregon/beaver_lake > ./trial.sh ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
        2: <mode> 1)

   In another message you wrote about a patch in the most current build. Is
that for 6.5 or 6.4? If the former, I'll grab the most recent from the svn
server and rebuild.

Thanks,

Rich

On Tue, Jan 17, 2012 at 5:07 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

Try

m.nviz.image -a ... to set the same mode (default is fine
resolution) for all raster maps or e.g.
m.nviz.image mode=fine,fine ...

Try it again and we will see

Anna,

With the `-a' option I see:

ERROR: Inconsistent number of attributes (<vline> 2: <vline_mode> 1)

This is similar problem, when you have more layers, you must specify
options for every layer:
... vline_mode=surface,surface ...

there will be probably more similar errors, so try to correct it the same way

use -a flag when you want the same options for raster layers

Anna

Without it (but with `mode=fine,fine':

ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
2: <resolution_fine> 1

Rich

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, Jan 17, 2012 at 4:43 PM, Martin Landa <landa.martin@gmail.com> wrote:

Hi,

2012/1/17 Martin Landa <landa.martin@gmail.com>:

2012/1/17 Martin Landa <landa.martin@gmail.com>:

This behaviour should be changed. If you do not define multiple values
for given parameters (like `wire_color`) then the module should use
default (single) value for all loaded surfaces.

ops, I overlooked (`-a` flag) see Anna's answer.

btw, I have fixed a bug related to this flag in r50239.

Probably we would not need this flag. From user point of view it would
be probably more understandable eg.

m.nviz.image elevation_map=elevation,roadsmajor out=elev mode=fine,coarse

would render the first surface in `fine` mode, second in `coarse`
mode. The rest of surface-related options (like `resolution_fine`)
would be used for both surfaces.

Make sense to you?

Definitely, the same problem is with vline_.../vpoint_... params

Anna

Martin

--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

This is similar problem, when you have more layers, you must specify
options for every layer:
... vline_mode=surface,surface ...

   I've used 2 options for the pair of raster maps.

use -a flag when you want the same options for raster layers

   So, the choice is then the -a flag with a single option or no -a flag and
2 options? Perhaps that's the problem: both flag and multiple options.

Rich

On Tue, Jan 17, 2012 at 6:37 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

This is similar problem, when you have more layers, you must specify
options for every layer:
... vline_mode=surface,surface ...

I've used 2 options for the pair of raster maps.

use -a flag when you want the same options for raster layers

So, the choice is then the -a flag with a single option or no -a flag and
2 options? Perhaps that's the problem: both flag and multiple options.

Yes, but -a flag works only for raster I think.

Maybe you could show the whole command and error, I'm a little lost
what's the problem now.

Anna

Rich
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

Maybe you could show the whole command and error, I'm a little lost what's
the problem now.

Anna,

   Yes, it's easy to become confused. Here's what I wrote in reponse to
Martin's message with sample command:
----------------------------------------------------------------------
Martin,

    It's a good idea to get this working one part at a time. So I copied the
above into a shell script and changed the elevation_map names to the
specific ones I need to use. I'm still getting the same error:

    Script:

m.nviz.image elevation_map=aber5m,mompano_rast out=elev mode=fine,fine
resolution_fine=6,6 resolution_coarse=9,9 style=surface,surface
shading=gouraud,gouraud wire_color=136:136:136,136:136:136

produces,

GRASS 6.5.svn (Oregon):~/grassdata/Oregon/beaver_lake > ./trial.sh ERROR: Inconsistent number of attributes (<elevation_map/elevation_value>
         2: <mode> 1)
-----------------------------------------------------------------------

   I keep getting the same error no matter the command entered. It should be
easier to debug with only the two raster maps. Once it's working with those
I can add the vectors/points.

Thanks,

Rich

On Tue, Jan 17, 2012 at 7:04 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

Maybe you could show the whole command and error, I'm a little lost what's
the problem now.

Anna,

Yes, it's easy to become confused. Here's what I wrote in reponse to
Martin's message with sample command:
----------------------------------------------------------------------

Martin,

It's a good idea to get this working one part at a time. So I copied the
above into a shell script and changed the elevation_map names to the
specific ones I need to use. I'm still getting the same error:

Script:

m.nviz.image elevation_map=aber5m,mompano_rast out=elev mode=fine,fine
resolution_fine=6,6 resolution_coarse=9,9 style=surface,surface
shading=gouraud,gouraud wire_color=136:136:136,136:136:136

produces,

GRASS 6.5.svn (Oregon):~/grassdata/Oregon/beaver_lake > ./trial.sh ERROR:
Inconsistent number of attributes (<elevation_map/elevation_value>
2: <mode> 1)
-----------------------------------------------------------------------

I keep getting the same error no matter the command entered. It should be
easier to debug with only the two raster maps. Once it's working with those
I can add the vectors/points.

The script above works for me (for my rasters), are you sure you use the same?

Anna

Thanks,

Rich
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Tue, 17 Jan 2012, Anna Kratochvílová wrote:

The script above works for me (for my rasters), are you sure you use the
same?

Anna,

   I must have a typo in there. I'll find it.

Thanks,

Rich