Opened 12 years ago

Last modified 8 years ago

#1635 new enhancement

allow r.los to run with a point vector layer as input for "coordinate identifying the viewing position"

Reported by: lutra Owned by: grass-dev@…
Priority: minor Milestone: 6.4.6
Component: Raster Version: svn-releasebranch64
Keywords: r.los, r.lake, r.viewshed, wxGUI, forms, generated dialogs Cc:
CPU: All Platform: All


This is my first feature request for GRASS.

It would be nice for modules like r.los (or even r.lake) to have the option to interactively create a list of coordinates or even use a vector point layer as input for "coordinate identifying the viewing position".

Change History (8)

comment:1 by hamish, 11 years ago

Component: DefaultRaster
CPU: UnspecifiedAll
Keywords: r.los r.lake added
Platform: UnspecifiedAll

as a work-around, you could try d.where in an xmon.

(Am I missing something, or is there no d.where-like coord query from the wxGUI display canvas? either copy current cursor coord to the clipboard or paste a list of them to the command output tab/window?)


comment:2 by neteler, 10 years ago

Version: unspecifiedsvn-releasebranch64

r.los, r.viewshed, etc. should be enhanced to support G_OPT_F_INPUT (file input incl stdin) for the "coordinates" parameter - like for its input.

Then the wxGUI may also pipe in interactively.

comment:3 by wenzeslaus, 10 years ago

Keywords: r.viewshed added

In r58688, I changed xy to standard coordinates option which enables to interactively pick coordinates from map display if you start G7:r.lake from the main GUI command console, menu or module tree.

This partially fulfills the original request for interactivity. However, there is no point in backporting this change as there is no standard coordinates option in GRASS 6.4 and more importantly no mouse coordinates picking from generated module forms/dialogs.

In trunk, G7:r.viewshed already has this standard coordinates option which is supported by wxGUI. G7:r.los does not.

Neither of these three supports multiple coordinates input, although G7:r.lake supports it using seed raster which makes more sense in this case except for cases when you want to add just few points (e.g. 2). The important thing is that supporting multiple coordinates goes far behind supporting more inputs, probably algorithm itself needs to be improved to fulfill the multiple point input required by the original request. Separate tickets for each modules would be better in this case.

I'm not sure what is more advantageous, if G_OPT_F_INPUT or G_OPT_M_COORDS with multiple=yes (I'm not sure how this is currently supported by GUI). The later would create less fields in GUI and less options. The former would partially replace G_OPT_M_COORDS, so there would be no possibility to input coordinates interactively (I mean mouse clicks on map, not writing the file content into dialog).

The solution would be to leave also the G_OPT_M_COORDS option (so in GUI there would be 4 possible inputs for r.lake: 2 for file, 1 raster, 1 coordinates). The alternative to many input fields is to create a new (GRASS) type file with coordinates which could recognized by GUI, so that it would behave similarly to G_OPT_M_COORDS.

The vector point layer is also interesting but for r.lake it would create 4th option how to input data (and vector could support also lines and areas to make it even more complicated).

The GUI part of G_OPT_M_COORDS cannot be backported easily, so 6 and 7 would require different solutions to this problem, so I think that this ticket cannot be solved for GRASS 6 but it would be nice to solve it for trunk.

The only thing which might be possible to add to GRASS 6 wxGUI is the right click on map which gives you possibility to copy coordinates pair.

Note that wxGUI does not care if the coordinates are inputted to module by parameter or standard input, actually, standard input might be easier to write. Note some modules in GRASS 7, mainly related to temporal framework, which supports parameter and file to input multiple maps (for cases when the number of maps is really large), for example see G7:r.colors.

I know, this was long, sorry.

comment:4 by wenzeslaus, 10 years ago

Keywords: wxGUI forms generated dialogs added

Current (timeline:2014-01-13T03:21) status in trunk:

So, in the main GUI they have button to pick coordinates pair from map display. I added note about G7:r.lake and G7:r.los changes to wiki:Grass7/NewFeatures.

The r58692 commit for trunk enables faster usage of coordinates copied from map display or d.mon wx0 (comma (583,2715) is used instead of semicolon (583;2715)). It might be possible to backport this trunk-only feature (the current change is trivial but the feature itself is not in GRASS 6).

comment:5 by neteler, 10 years ago

For the record: I check (hopefully) all other GRASS 7 modules, here the remaining candidates for update to use G_OPT_M_COORDS:

  • display/d.profile/main.c (maybe)
  • misc/m.transform/main.c (maybe)
  • raster/
  • raster/r.horizon/main.c

comment:6 by martinl, 9 years ago

Milestone: 6.4.5

Ticket retargeted after milestone closed

comment:7 by martinl, 9 years ago

Milestone: 6.4.6

in reply to:  5 comment:8 by neteler, 8 years ago

For the record:

Replying to neteler:

For the record: I check (hopefully) all other GRASS 7 modules, here the remaining candidates for update to use G_OPT_M_COORDS:

  • display/d.profile/main.c (maybe)
  • misc/m.transform/main.c (maybe)
  • raster/
  • raster/r.horizon/main.c

... all long time done in G7 except for misc/m.transform/main.c where is is not needed.

Note: See TracTickets for help on using tickets.