[GRASS-user] Displaying site_name on r.watershed output basins map

   One output map from r.watersheds is identified basins. I want to use this
output for input to r.basin to calculate descriptors for each one. When I
query the output map I am shown a numeric site_name for each calculated
basin (see attached map with vector streams overlaid).

   Is there a way to display the site_name on each colored basin? This would
make it much easier to communicate basin descriptions by illustrating where
each basin is located in the area. I've looked through the list of r.*
modules and did not find one that would do this task.

Thanks,

Rich

(attachments)

qusa-basins.pdf (62.9 KB)

On Mon, 30 Apr 2012, Rich Shepard wrote:

Is there a way to display the site_name on each colored basin? This would
make it much easier to communicate basin descriptions by illustrating
where each basin is located in the area. I've looked through the list of
r.* modules and did not find one that would do this task.

   Related question: how can I obtain the areas of the calculated basins? I
tried r.to.vect but the output map has no attribute table associated with
it.

Rich

On Mon, 30 Apr 2012, Rich Shepard wrote:

Related question: how can I obtain the areas of the calculated basins? I
tried r.to.vect but the output map has no attribute table associated with
it.

   Answer: r.basin.

Rich

Hi,

On Tue, May 1, 2012 at 12:17 AM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Mon, 30 Apr 2012, Rich Shepard wrote:

Is there a way to display the site_name on each colored basin? This would
make it much easier to communicate basin descriptions by illustrating
where each basin is located in the area. I’ve looked through the list of
r.* modules and did not find one that would do this task.

Related question: how can I obtain the areas of the calculated basins? I
tried r.to.vect but the output map has no attribute table associated with
it.

This is weird. Which is the exact command line you used? should be something like:

r.to.vect input=basins output=basins feature=area

Once you have that, you can use v.label to display labels, and calculate the area using v.db.addcol + v.to.db

HTH
madi

Rich


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


Ing. Margherita Di Leo, Ph.D.

On Tue, 1 May 2012, Margherita Di Leo wrote:

This is weird. Which is the exact command line you used? should be
something like:

Madi,

   I used the GUI; will try again with the command line (my preference,
anyway).

r.to.vect input=basins output=basins feature=area

   I used a different output name, but did specify area as the feature.

Once you have that, you can use v.label to display labels, and calculate
the area using v.db.addcol + v.to.db

   Didn't do this ... but I will. This is good information for me.

   I also confirmed that r.basin calculates area as part of its output.

Many thanks,

Rich

Rich,

On Tue, May 1, 2012 at 3:47 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Tue, 1 May 2012, Margherita Di Leo wrote:

This is weird. Which is the exact command line you used? should be
something like:

Madi,

I used the GUI; will try again with the command line (my preference,
anyway).

Using the GUI, you can check the correspondent command line displayed in the bottom part of the command window.

r.to.vect input=basins output=basins feature=area

I used a different output name, but did specify area as the feature.

This doesn’t affect the result at all, it was just for example.

Once you have that, you can use v.label to display labels, and calculate
the area using v.db.addcol + v.to.db

Didn’t do this … but I will. This is good information for me.

I also confirmed that r.basin calculates area as part of its output.

Many thanks,

You are welcome
madi

Rich


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


Ing. Margherita Di Leo, Ph.D.

r.to.vect input=basins output=basins feature=area

I used a different output name, but did specify area as the feature.

This doesn’t affect the result at all, it was just for example.

I mean, the output’s name doesn’t affect the result. The feature=area matters, obviously.

ciao
madi


Ing. Margherita Di Leo, Ph.D.

On Tue, 1 May 2012, Margherita Di Leo wrote:

r.to.vect input=basins output=basins feature=area
Once you have that, you can use v.label to display labels.

   I must be doing something incorrectly. After running r.to.vect I ran
v.label specifying 'value' as the attribute column. No labels display even
after I specify the attribute column, color, and size in the GUI dialog. The
command displayed at the bottom of the GUI dialog box reflects the choices
made above.

   What might inhibit the display of the labels?

Rich

r.to.vect input=basins output=basins feature=area
Once you have that, you can use v.label to display labels.

I must be doing something incorrectly. After running r.to.vect I ran
v.label specifying ‘value’ as the attribute column. No labels display even
after I specify the attribute column, color, and size in the GUI dialog. The
command displayed at the bottom of the GUI dialog box reflects the choices
made above.

Have a look that you’ve enabled displaying of an attribute column. In the GUI, it’s on the “Required” tab as “Display selected attribute based on attrcol”. On the CLI "d.vect disp=shape,attr "
This always trips me up also. Should be a FAQ. And perhaps the “Display attribute…” should get enabled somehow automatically whenever an attribute column for labeling is chosen.

···
-- 
Micha Silver
052-3665918

On Wed, 2 May 2012, Micha Silver wrote:

Have a look that you've enabled displaying of an attribute column. In the
GUI, it's on the "Required" tab as "Display selected attribute based on
attrcol". On the CLI "d.vect disp=shape,attr " This always trips me up
also. Should be a FAQ. And perhaps the "Display attribute..." should get
enabled somehow automatically whenever an attribute column for labeling is
chosen.

Micha,

   I saw that before I wrote for help, but checking the attribute checkbox
makes no difference. I cannot display either the cat numbers nor the
raster map site_name which is the value column in the vector table.

   When I uncheck all features but area the display clears. I have to try
various options before the boundaries re-appear.

   From the command line, writing to d.mon x0:

GRASS 6.5.svn :~/grassdata > d.vect map=basinv disp=shape,attr type=area fcolor=none attrcol=value

produces the attached 'basinv.png'.

   A portion of the attribute table, generated by

GRASS 6.5.svn :~/grassdata > db.select sql="select * from basinv"

is,

cat|value|label
1|8|
3|114|
4|194|
5|190|
6|116|
7|184|
8|198|
9|120|
10|2|
11|192|
12|188|
13|6|
14|188|
15|172|
16|120|
17|4|
18|158|
19|192|
20|192|
21|192|
22|196|
23|118|
24|118|

   I'm not seeing what I've written incorrectly.

Thanks,

Rich

(attachments)

basinv.png

On Wed, May 2, 2012 at 8:20 AM, Micha Silver <micha@arava.co.il> wrote:

Have a look that you’ve enabled displaying of an attribute column. In the GUI, it’s on the “Required” tab as “Display selected attribute based on attrcol”. On the CLI "d.vect disp=shape,attr "
This always trips me up also. Should be a FAQ. And perhaps the “Display attribute…” should get enabled somehow automatically whenever an attribute column for labeling is chosen.

+1

Ing. Margherita Di Leo, Ph.D.

Rich,

On Wed, May 2, 2012 at 3:52 PM, Rich Shepard <rshepard@appl-ecosys.com> wrote:

On Wed, 2 May 2012, Micha Silver wrote:

Have a look that you’ve enabled displaying of an attribute column. In the
GUI, it’s on the “Required” tab as “Display selected attribute based on
attrcol”. On the CLI "d.vect disp=shape,attr " This always trips me up
also. Should be a FAQ. And perhaps the “Display attribute…” should get
enabled somehow automatically whenever an attribute column for labeling is
chosen.

Micha,

I saw that before I wrote for help, but checking the attribute checkbox
makes no difference. I cannot display either the cat numbers nor the
raster map site_name which is the value column in the vector table.

When I uncheck all features but area the display clears. I have to try
various options before the boundaries re-appear.

From the command line, writing to d.mon x0:

GRASS 6.5.svn :~/grassdata > d.vect map=basinv disp=shape,attr type=area fcolor=none attrcol=value

what does v.info map=basinv say?


Ing. Margherita Di Leo, Ph.D.

On Wed, 2 May 2012, Margherita Di Leo wrote:

what does v.info map=basinv say?

Map scale: 1:1
Map format: native
Name of creator: rshepard
Organization:
Source date: Wed May 2 10:42:33 2012
----------------------------------------------------------------------------
Type of Map: vector (level: 2)
Number of points: 0 Number of areas: 378
Number of lines: 0 Number of islands: 1
Number of boundaries: 835 Number of faces: 0
Number of centroids: 377 Number of kernels: 0

Map is 3D: No
Number of dblinks: 1

Projection: Transverse Mercator

N: 28704643.97591617 S: 28589696.29729814
E: 628305.08857358 W: 464582.93917488

Digitization threshold: 0

Rich

On Wed, May 2, 2012 at 10:25 PM, Margherita Di Leo <diregola@gmail.com> wrote:

On Wed, May 2, 2012 at 8:20 AM, Micha Silver <micha@arava.co.il> wrote:

Have a look that you've enabled displaying of an attribute column. In the
GUI, it's on the "Required" tab as "Display selected attribute based on
attrcol". On the CLI "d.vect disp=shape,attr "
This always trips me up also. Should be a FAQ. And perhaps the "Display
attribute..." should get enabled somehow automatically whenever an attribute
column for labeling is chosen.

+1

Please edit the GRASS Wiki:
http://grass.osgeo.org/wiki/FAQ

or send a text snippet for (which) manual page(s) to the list.
Or write an enhancement ticket to trac:
http://trac.osgeo.org/grass/

thanks
Markus