[GRASS-dev] [GRASS GIS] #2122: v.to.db: new variables to add

#2122: v.to.db: new variables to add
--------------------------+--------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.4.0
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.to.db eigenvalues bbox
       CPU: All | Platform: All
--------------------------+--------------------------------------

Comment (by hellik):

Replying to [comment:11 mlennert]:
> I finally decided to just go ahead and commit to facilitate testing
(r70451).

thanks for the implementation:

tested with

{{{
System Info
GRASS version: 7.3.svn
GRASS SVN revision: r70453
Build date: 2017-01-30
Build platform: x86_64-w64-mingw32
GDAL: 2.1.2
PROJ.4: 4.9.3
GEOS: 3.5.0
SQLite: 3.14.1
Python: 2.7.5
wxPython: 2.8.12.1
Platform: Windows-8-6.2.9200 (OSGeo4W)
}}}

{{{
g.copy vector=lakes@PERMANENT,mylakes
Copy vector <lakes@PERMANENT> to current mapset as <mylakes>
}}}

{{{
v.to.db map=mylakes@user1 option=bbox columns=t,b,r,l
Reading areas...
Updating database...
15279 categories read from vector map (layer 1)
15279 records selected from table (layer 1)
15279 categories read from vector map exist in selection from table
15279 records updated/inserted (layer 1)
}}}

{{{
v.db.select map=mylakes@user1
cat|AREA|PERIMETER|FULL_HYDRO|FULL_HYDR2|FTYPE|FCODE|NAME|t|b|r|l
1|280261.46103|2853.9372|2|55626|LAKE/POND|39000||258302.909848466|258130.034036035|636012.26029972|635790.715367031
2|6754.6563|404.28643|3|55650|DAM/WEIR|34300||258248.323799814|258193.490779749|636431.09504699|636410.782219965
3|19512.86146|708.44683|4|55652|LAKE/POND|39000||258245.544932657|258192.348996665|636490.942646686|636425.805537212
4|1132.10986|151.16533|5|53514|LAKE/POND|39000||258212.396727567|258203.793649957|637196.254140018|637177.667259335
5|2849.43244|249.99941|6|53510|DAM/WEIR|34300||258210.786516747|258193.870561307|637209.225457828|637177.667259335
6|5908.42064|413.13377|7|55640|DAM/WEIR|34300||258181.2788371|258130.602489171|636960.29029048|636934.092252985
7|18807.73989|567.89134|8|55644|LAKE/POND|39000||258181.2788371|258125.193192754|636995.050850902|636941.778105157
8|5310.04399|334.89296|9|55660|LAKE/POND|39000||258172.628397222|258130.594259555|635797.542291085|635770.696062993
}}}

seems to work; nice addition to v.to.db.

>In the case of multiple features by category the module now calculates
the total bounding >box for all features with same category.

it's the best way to handle this.

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