[GRASS-user] manually selecting a region

Hi List,

I'd like to manually select a region of an image. It seems like the g.gui.vdigit tool might be the right way to do this. However, when I run it I get the following message:

ERROR: Vector digitizer not available. cannot import name GV_LINES

Is there another tool that will let me select a region?

Thanks,

  -k.

I found the code I used to use for this feature - d.what.rast in GRASS 6.4. But the interactive mouse selection seems to have been removed in GRASS 7.2. Is there a replacement?

···

On Sat, Mar 4, 2017 at 7:53 PM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi List,

I’d like to manually select a region of an image. It seems like the g.gui.vdigit tool might be the right way to do this. However, when I run it I get the following message:

ERROR: Vector digitizer not available. cannot import name GV_LINES

Is there another tool that will let me select a region?

Thanks,

-k.

On Sun, Mar 5, 2017 at 1:53 AM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi List,

I'd like to manually select a region of an image. It seems like the g.gui.vdigit tool might be the right way to do this. However, when I run it I get the following message:

ERROR: Vector digitizer not available. cannot import name GV_LINES

Strange, please post a bit more about version and operating system.

Is there another tool that will let me select a region?

Starting from GRASS GIS 7.2 there is a raster digitizer (find it in
the drop-down list in the Map Display Window of the GUI).

See also at the end of this section:
https://grass.osgeo.org/grass72/manuals/wxGUI.html#map-display-window

Markus

On Sun, Mar 5, 2017 at 8:28 AM, Ken Mankoff <mankoff@gmail.com> wrote:

I found the code I used to use for this feature - d.what.rast in GRASS 6.4.
But the interactive mouse selection seems to have been removed in GRASS 7.2.
Is there a replacement?

On Sat, Mar 4, 2017 at 7:53 PM, Ken Mankoff <mankoff@gmail.com> wrote:

Hi List,

I'd like to manually select a region of an image. It seems like the
g.gui.vdigit tool might be the right way to do this. However, when I run it
I get the following message:

ERROR: Vector digitizer not available. cannot import name GV_LINES

Is there another tool that will let me select a region?

There is a tool in Map Display toolbar to 'Set computational region
extent interactively' under 'various zoom options'

Anna

Thanks,

  -k.

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

Hi Markus,

On 2017-03-05 at 17:50, Markus Neteler <neteler@osgeo.org> wrote:

On Sun, Mar 5, 2017 at 1:53 AM, Ken Mankoff <mankoff@gmail.com> wrote:

I'd like to manually select a region of an image. It seems like the
g.gui.vdigit tool might be the right way to do this. However, when I
run it I get the following message:

ERROR: Vector digitizer not available. cannot import name GV_LINES

Strange, please post a bit more about version and operating system.

OS X
GRASS 7.2
Built as per https://grasswiki.osgeo.org/wiki/Compiling_on_MacOSX_using_homebrew#GRASS_7.2

Is there another tool that will let me select a region?

Starting from GRASS GIS 7.2 there is a raster digitizer (find it in
the drop-down list in the Map Display Window of the GUI).

See also at the end of this section:
https://grass.osgeo.org/grass72/manuals/wxGUI.html#map-display-window

I did not know about that "raster digitizer". Thank you. When I try to use it, wherever I click I just get a popup message, "Message. Please select first the raster map". I'm not sure what to do about that.

To explain my use case more clearly, I'm using the CLI not the GUI. I'm looping over ~100 maps that need the user to select a location in each one. I currently have this code (in a loop):

d.mon start=wx0
sleep 5
d.rgb red=R green=G blue=B
d.grid size=500 origin=${X},${Y}
d.vect table@RS where="scene == '${SCENE}'" color=red

read -n 1 -s -p "right click on monitor wx0 and select 'copy coordinates to clipboard', then press any key to continue"

d.mon stop=wx0
ice_x=$(echo $(pbpaste) | cut -d"," -f1)
ice_y=$(echo $(pbpaste) | cut -d"," -f2)

I think this might work in a GRASS script but my workflow sends this to a buffer in emacs, effectively as a cut-and-paste job. Therefore the text after the "read" command (d.mon stop=wx0) is interpreted as input, and I don't get a chance to click on the map. If I could use the "d.where" from grass64, and have the "d.where" command block input until the mouse is clicked, everything would work. I'm hoping to replicate this functionality in grass7.2

  -k.

Does “d.where” work for others? I’ve tested it on OS X GRASS 7.2 and Linux GRASS 7.0.4 and I receive no feedback when I run the program.​

On 06/03/17 18:24, Ken Mankoff wrote:

Does "d.where" work for others? I've tested it on OS X GRASS 7.2 and
Linux GRASS 7.0.4 and I receive no feedback when I run the program.​

AFAIK, d.where does not allow direct interaction with the display anymore. It "just" takes screen coordinates and outputs them as map coordinates. In GRASS 6 you could get the screen coordinates by clicking on the d.mon display, but in GRASS 7 this is handled by the GUI (g.gui or d.mon wx*). In other words you chose the GUI interrogation tool and when you click on the monitor, it launches d.where and you get the coordinates. You can ask for these coordinates to be redirected to the console.

I agree that the current solution is not ideal. For example, it is not straightforward how to collect the info into a file. Also: the output is not really as machine-parsing friendly as it could.

See https://trac.osgeo.org/grass/ticket/3310 and add to it if you think something is missing.

Moritz

On Tue, Mar 7, 2017 at 4:11 AM, Moritz Lennert <mlennert@club.worldonline.be

wrote:

AFAIK, d.where does not allow direct interaction with the display anymore.
It "just" takes screen coordinates and outputs them as map coordinates. In
GRASS 6 you could get the screen coordinates by clicking on the d.mon
display, but in GRASS 7 this is handled by the GUI (g.gui or d.mon wx*). In
other words you chose the GUI interrogation tool and when you click on the
monitor, it launches d.where and you get the coordinates. You can ask for
these coordinates to be redirected to the console.

I agree that the current solution is not ideal. For example, it is not
straightforward how to collect the info into a file. Also: the output is
not really as machine-parsing friendly as it could.

See https://trac.osgeo.org/grass/ticket/3310 and add to it if you think
something is missing.

Thanks for the reply. I will think about and add suggestions to the ticket.
Let me know if I can help debug the "ERROR: Vector digitizer not available.
cannot import name GV_LINES" issue.

  -k.

On Tue, Mar 7, 2017 at 7:41 AM, Ken Mankoff <mankoff@gmail.com> wrote:

On Tue, Mar 7, 2017 at 4:11 AM, Moritz Lennert
<mlennert@club.worldonline.be> wrote:

AFAIK, d.where does not allow direct interaction with the display anymore.
It "just" takes screen coordinates and outputs them as map coordinates. In
GRASS 6 you could get the screen coordinates by clicking on the d.mon
display, but in GRASS 7 this is handled by the GUI (g.gui or d.mon wx*). In
other words you chose the GUI interrogation tool and when you click on the
monitor, it launches d.where and you get the coordinates. You can ask for
these coordinates to be redirected to the console.

I agree that the current solution is not ideal. For example, it is not
straightforward how to collect the info into a file. Also: the output is not
really as machine-parsing friendly as it could.

See https://trac.osgeo.org/grass/ticket/3310 and add to it if you think
something is missing.

Thanks for the reply. I will think about and add suggestions to the ticket.
Let me know if I can help debug the "ERROR: Vector digitizer not available.
cannot import name GV_LINES" issue.

That seems to be problem with ctypes, I've seen this on Mac before. Do
you compile grass on your own, or use homebrew? I know some students
used osgeo4mac and they couldn't use digitizer, 3D view and pygrass at
all. But when I compile GRASS myself, it works.

Anna

  -k.

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

On Tue, Mar 7, 2017 at 9:02 AM, Anna Petrášová <kratochanna@gmail.com>
wrote:

That seems to be problem with ctypes, I've seen this on Mac before. Do
you compile grass on your own, or use homebrew? I know some students
used osgeo4mac and they couldn't use digitizer, 3D view and pygrass at
all. But when I compile GRASS myself, it works

Homebrew seems to be the culprit here.

  -k.