[GRASS-dev] [GRASS GIS] #787: v.in.db: add v.in.ogr-like "-t" option

#787: v.in.db: add v.in.ogr-like "-t" option
--------------------------+-------------------------------------------------
Reporter: grasslandtom | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: normal | Milestone: 6.4.0
Component: Vector | Version: unspecified
Keywords: v.in.db | Platform: Unspecified
      Cpu: Unspecified |
--------------------------+-------------------------------------------------
An option to v.in.db that allows importing points without creating an
attribute table from the original table would be useful to avoid copying
of (especially large) tables when attributes are either not needed in
GRASS or the original table will be connected to the resulting vector.

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

#787: v.in.db: add v.in.ogr-like "-t" option
---------------------------+------------------------------------------------
  Reporter: grasslandtom | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: unspecified
Resolution: | Keywords: v.in.db
  Platform: Unspecified | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by hamish):

v.db.select | v.in.ascii -t

?

the whole point of v.to.db is to add stuff to a table.

Hamish

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

#787: v.in.db: add v.in.ogr-like "-t" option
---------------------------+------------------------------------------------
  Reporter: grasslandtom | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: unspecified
Resolution: invalid | Keywords: v.in.db
  Platform: Unspecified | Cpu: Unspecified
---------------------------+------------------------------------------------
Changes (by grasslandtom):

  * status: new => closed
  * resolution: => invalid

Comment:

Oops! I see, I should have asked on the mailinglist before filing this.

Nevertheless: what I meant was something like

{{{
#import vector from table without copying the table:
v.in.db -t sometable x=x_col y=y_col cat=id_col out=somevector
# connect to original table
v.db.connect somevector table=sometable key=id_col
}}}

But this could be mimicked by

{{{
db.select sometable sql='select x_col,y_col,id_col from sometable' |
v.in.ascii -t cat=3 out=somevector
v.db.connect somevector table=sometable key=id_col
}}}

Thus I set this to resolved as invalid.

Thanks for the hint with the pipe! Sorry for being to quick asking here.

Tom

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

#787: v.in.db: add v.in.ogr-like "-t" option
---------------------------+------------------------------------------------
  Reporter: grasslandtom | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: unspecified
Resolution: invalid | Keywords: v.in.db
  Platform: Unspecified | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by neteler):

Tom, please consider to make this a FAQ entry at
http://grass.osgeo.org/wiki/Category:FAQ

Markus

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

#787: v.in.db: add v.in.ogr-like "-t" option
---------------------------+------------------------------------------------
  Reporter: grasslandtom | Owner: grass-dev@lists.osgeo.org
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: unspecified
Resolution: invalid | Keywords: v.in.db
  Platform: Unspecified | Cpu: Unspecified
---------------------------+------------------------------------------------
Comment (by grasslandtom):

For the sake of completeness: I missed the c-flag for db.select (or as an
alternative skip=1 for v.in.ascii).

I will add the whole thing to the FAQ later.

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

#787: v.in.db: add v.in.ogr-like "-t" option
---------------------------+------------------------------------------------
  Reporter: grasslandtom | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 6.4.0
Component: Vector | Version: unspecified
Resolution: invalid | Keywords: v.in.db
  Platform: Unspecified | Cpu: Unspecified
---------------------------+------------------------------------------------

Comment(by grasslandtom):

Thinking about a useful title for a FAQ-entry, I came to the conclusion
that it might be better to add this as an example to the man-page of
v.in.db. Though v.in.db is not used in the example, as a user I would
search that man-page for a solution to the initialy described problem:
"Import coordinates from table and use original table for attributes".

Any thoughts on this?

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