[GRASS-dev] [GRASS GIS] #251: Enhancements to vector querying

#251: Enhancements to vector querying
--------------------------+-------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.0
Component: Vector | Version:
Keywords: query vector | Platform: All
      Cpu: All |
--------------------------+-------------------------------------------------
About 9 months ago, I suggested an overhaul of the GRASS vector query
framework (original post <http://lists.osgeo.org/pipermail/grass-dev/2007-
September/033173.html>)

Now that work has started on GRASS 7 in ernest, I'd like to reiterate
this. Besides giving GRASS a simpler and richer query ability, it would
permit much easier GUI interface to vector querying--such as interactively
drawing a box or polygon around points to select them for query in the new
database table manager.

So here is the idea. It involves some upgrades to modules we already have,
but no new modules. The nice thing is we are almost there. I'll also drop
this in the bug tracker as an enhancement suggestion.

'''v.select (query using a vector map):'''
1. add flags -p and -g for text output instead of creating a new map. It
would report which map(s) and feature(s)/cat(s) meet the query criteria.
2. allow multiple maps to be selected. This would directly address Eric's
question. If the output is a map, it would be the equivalent of v.patch on
all queried vector elements.
3. add operators "contains" and "adjacent". Contains=all vector features
whose nodes are completely inside a polygon (or inside or touching the
boundary). Adjacent=all vector features who share a node/point or
line/boundary with the selecting feature. Because GRASS is topologically
correct, adjacency information is readily available.
4. maybe change option names from ainput and binput to selector and
selected or queried. This would have to wait until GRASS 7, of course. I
find ainput and binput not very clear where used in other vector
operations either (maybe I'm just dense).

'''v.what (query using coordinates): '''
1. add flags -p and -g for current behavior (-pg could be the default if
we wanted to do this before GRASS 7)
2. add "output=" option to allow v.what to create a new map from the
results of its query, like v.select does
3. allow multiple maps for input, as with the suggestion for v.select
4. allow coordinates to be read optionally as a line or area/boundary (-l
or -a?) instead of only as individual points.
5. add operators overlap, contains, adjacent. (This also would make
possible interactive vector selection with a mouse drawn box or polygon
from the GUI) In other words, have v.select and v.what work the same
except that v.select uses a vector map for querying and v.what uses a set
of coordinate points.

'''v.overlay (boolean combination of maps):'''
1. drop the ainput and binput. Replace with just input.
2. allow multiple maps to be entered into input, not just 2
3. deprecate v.patch because v.overlay with the OR operator replaces it.
(If we wanted to do this before GRASS 7, we'd have to create a new module,
maybe named v.combine or something like that because this changes the
default behavior of v.overlay)

Michael

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/251&gt;
GRASS GIS <http://grass.osgeo.org>

#251: Enhancements to vector querying
--------------------------+-------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.4.0
Component: Vector | Version:
Resolution: | Keywords: query vector
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Comment (by Vincent):

> '''v.what (query using coordinates): '''
> 1. add flags -p and -g for current behavior (-pg could be the default if
we wanted to do this before GRASS 7)
> 2. add "output=" option to allow v.what to create a new map from the
results of its query, like v.select does
> 3. allow multiple maps for input, as with the suggestion for v.select
> 4. allow coordinates to be read optionally as a line or area/boundary
(-l or -a?) instead of only as individual points.
> 5. add operators overlap, contains, adjacent. (This also would make
possible interactive vector selection with a mouse drawn box or polygon
from the GUI) In other words, have v.select and v.what work the same
except that v.select uses a vector map for querying and v.what uses a set
of coordinate points.

As I suggested on a recent thread on the users list, the scope of these
questions is quite important for users dealing with ''data creation''. In
an actual procedure of digitizing and attributes filling-in, it's crucial
to dispose of ergonomic solutions (and as you say
''the nice thing is we are almost there'' !).

It would be great to be able to make a multiple selection of objects with
the mouse in the display (or a monitor, anyway) with the ability to,
'''''on the fly''''' :
  * add-select and un-select (e.g. via Ctrl key) ;
  * pan and zoom (e.g. space bar for panning, and mouse scroll for zooming)
;
  * viewing in real time the selected set on the display (highlight).

Such a module\command (let's say v.selmany), only dedicated for returning
an array of `cat` values, would be a very interesting starting point to
various other commands, and personal scripting.

Vincent

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/251#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#251: Enhancements to vector querying
--------------------------+-------------------------------------------------
  Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: major | Milestone: 6.5.0
Component: Vector | Version: svn-develbranch6
Resolution: | Keywords: query vector
  Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by neteler):

  * version: => svn-develbranch6
  * milestone: 6.4.0 => 6.5.0

Comment:

I have added the -g flag (shell script style output) to v.what in 6.5.svn
and 7.svn.

Markus

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/251#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

Thanks Markus. A good start.

Michael
____________________
C. Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

Phone: 480-965-6262
Fax: 480-965-7671
www: <www.public.asu.edu/~cmbarton>

On Apr 6, 2009, at 6:08 AM, GRASS GIS wrote:

#251: Enhancements to vector querying
--------------------------+-------------------------------------------------
Reporter: cmbarton | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: major | Milestone: 6.5.0
Component: Vector | Version: svn-develbranch6
Resolution: | Keywords: query vector
Platform: All | Cpu: All
--------------------------+-------------------------------------------------
Changes (by neteler):

* version: => svn-develbranch6
* milestone: 6.4.0 => 6.5.0

Comment:

I have added the -g flag (shell script style output) to v.what in 6.5.svn
and 7.svn.

Markus

--
Ticket URL: <#251 (Enhancements to vector querying) – GRASS GIS;
GRASS GIS <http://grass.osgeo.org>