[GRASS-dev] [GRASS-SVN] r70710 - in grass/branches/releasebranch_7_2: lib/vector/vedit raster/r.timestamp raster/r.to.vect raster/r.topidx raster/r.topmodel scripts/v.db.addtable vector/v.build.polylines vector/v.distance vector/v.edit vector/v.patch vector/v.select vector/v.to.db vector/v.to.points vector/v.what
Martin Landa
landa.martin at gmail.com
Wed Mar 1 04:31:50 PST 2017
Hi,
please *explain* your changes in log message next time. It's
flustrating for those who are preparing news page about release to dig
into such commits. Log message should help to understand what is
purpose of the commit.
Thanks for taking care about backports. Ma
2017-03-01 12:45 GMT+01:00 <svn_grass at osgeo.org>:
> Author: hcho
> Date: 2017-03-01 03:45:44 -0800 (Wed, 01 Mar 2017)
> New Revision: 70710
>
> Added:
> grass/branches/releasebranch_7_2/raster/r.to.vect/set_error_handler.c
> Modified:
> grass/branches/releasebranch_7_2/lib/vector/vedit/break.c
> grass/branches/releasebranch_7_2/lib/vector/vedit/move.c
> grass/branches/releasebranch_7_2/lib/vector/vedit/vertex.c
> grass/branches/releasebranch_7_2/raster/r.timestamp/r.timestamp.html
> grass/branches/releasebranch_7_2/raster/r.to.vect/areas_io.c
> grass/branches/releasebranch_7_2/raster/r.to.vect/global.h
> grass/branches/releasebranch_7_2/raster/r.to.vect/main.c
> grass/branches/releasebranch_7_2/raster/r.topidx/r.topidx.html
> grass/branches/releasebranch_7_2/raster/r.topmodel/r.topmodel.html
> grass/branches/releasebranch_7_2/scripts/v.db.addtable/v.db.addtable.py
> grass/branches/releasebranch_7_2/vector/v.build.polylines/main.c
> grass/branches/releasebranch_7_2/vector/v.build.polylines/walk.c
> grass/branches/releasebranch_7_2/vector/v.distance/main.c
> grass/branches/releasebranch_7_2/vector/v.distance/v.distance.html
> grass/branches/releasebranch_7_2/vector/v.edit/main.c
> grass/branches/releasebranch_7_2/vector/v.edit/max_distance.c
> grass/branches/releasebranch_7_2/vector/v.patch/main.c
> grass/branches/releasebranch_7_2/vector/v.select/copy_tabs.c
> grass/branches/releasebranch_7_2/vector/v.select/main.c
> grass/branches/releasebranch_7_2/vector/v.to.db/main.c
> grass/branches/releasebranch_7_2/vector/v.to.points/write.c
> grass/branches/releasebranch_7_2/vector/v.what/main.c
> Log:
> Backport r70666, r70637, r70636, r70635, r70634, r70633, r70706, r70707, r70708, r70611, r70612, r70613, r70614, r70599, r70589, r70586, r70582, r70537, r70509, r70506, r70709, r70507, r69139
>
>
>
> Modified: grass/branches/releasebranch_7_2/lib/vector/vedit/break.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/lib/vector/vedit/break.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/lib/vector/vedit/break.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -247,12 +247,13 @@
> line_new = -1;
>
> if (line_new > -1) {
> + n_points = Points_from->n_points - 1;
> +
> if (first) {
> x = Points_from->x[0];
> y = Points_from->y[0];
> }
> else {
> - n_points = Points_from->n_points - 1;
> x = Points_from->x[n_points];
> y = Points_from->y[n_points];
> }
>
> Modified: grass/branches/releasebranch_7_2/lib/vector/vedit/move.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/lib/vector/vedit/move.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/lib/vector/vedit/move.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -71,7 +71,7 @@
>
> for (bgi = 0; bgi < nbgmaps; bgi++) {
> if (Vedit_snap_point
> - (BgMap[bgi], line, &x[j], &y[j], &z[j], thresh,
> + (BgMap[bgi], -1, &x[j], &y[j], &z[j], thresh,
> (snap == SNAPVERTEX) ? 1 : 0))
> break; /* snapped, don't continue */
> }
>
> Modified: grass/branches/releasebranch_7_2/lib/vector/vedit/vertex.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/lib/vector/vedit/vertex.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/lib/vector/vedit/vertex.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -115,7 +115,7 @@
>
> for (bgi = 0; bgi < nbgmaps; bgi++) {
> if (Vedit_snap_point
> - (BgMap[bgi], line, &x[k], &y[k],
> + (BgMap[bgi], -1, &x[k], &y[k],
> &z[k], thresh_snap,
> (snap == SNAPVERTEX) ? 1 : 0))
> moved[k] = 2;
>
> Modified: grass/branches/releasebranch_7_2/raster/r.timestamp/r.timestamp.html
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.timestamp/r.timestamp.html 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/raster/r.timestamp/r.timestamp.html 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -15,7 +15,7 @@
>
> The timestamp values must use the format as described in the <em>GRASS
> Datetime Library</em>. The source tree for this library should have a
> -description of the format. For convience, the formats are reproduced
> +description of the format. For convenience, the formats are reproduced
> here:
>
> <p>There are two types of datetime values:
>
> Modified: grass/branches/releasebranch_7_2/raster/r.to.vect/areas_io.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.to.vect/areas_io.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/raster/r.to.vect/areas_io.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -34,7 +34,7 @@
> int write_boundary(struct COOR *seed)
> {
> struct COOR *point, *line_begin, *line_end, *last;
> - int dir, line_type, n, n1, i;
> + int dir, line_type, n, n1;
>
> point = seed;
> if ((dir = at_end(point))) { /* already have one end of line */
>
> Modified: grass/branches/releasebranch_7_2/raster/r.to.vect/global.h
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.to.vect/global.h 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/raster/r.to.vect/global.h 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -104,7 +104,7 @@
> int extract_lines(void);
>
> /* lines_io.c */
> -int write_line(struct COOR *seed);
> +int write_line(struct COOR *);
>
> /* areas.c */
> int alloc_areas_bufs(int);
> @@ -112,7 +112,7 @@
> int more_equivs(void);
>
> /* areas_io.c */
> -int write_boundary(struct COOR *seed);
> +int write_boundary(struct COOR *);
> int write_area(struct area_table *, struct equiv_table *, int, int);
>
> /* points.c */
> @@ -124,4 +124,7 @@
> int at_end(struct COOR *);
> int read_row(void *);
> void insert_value(int, int, double);
> -int free_ptr(struct COOR *ptr);
> +int free_ptr(struct COOR *);
> +
> +/* set_error_handler.c */
> +void set_error_handler(struct Map_info *, dbDriver **);
>
> Modified: grass/branches/releasebranch_7_2/raster/r.to.vect/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.to.vect/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/raster/r.to.vect/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -8,7 +8,7 @@
> *
> * PURPOSE: Converts a raster map into a vector map layer
> *
> - * COPYRIGHT: (C) 2007, 2011 by the GRASS Development Team
> + * COPYRIGHT: (C) 2007, 2011, 2017 by the GRASS Development Team
> *
> * This program is free software under the GNU General Public
> * License (>=v2). Read the file COPYING that comes with GRASS
> @@ -151,10 +151,11 @@
> G_warning(_("Categories will be unique sequence, raster values will be lost."));
> }
>
> + set_error_handler(&Map, &driver);
> +
> if (Vect_open_new(&Map, out_opt->answer, z_flg->answer) < 0)
> G_fatal_error(_("Unable to create vector map <%s>"), out_opt->answer);
> - Vect_set_error_handler_io(NULL, &Map);
> -
> +
> Vect_hist_command(&Map);
>
> Cats = Vect_new_cats_struct();
> @@ -186,7 +187,6 @@
> if (driver == NULL)
> G_fatal_error(_("Unable to open database <%s> by driver <%s>"),
> Fi->database, Fi->driver);
> - db_set_error_handler_driver(driver);
>
> /* Create new table */
> db_zero_string(&sql);
>
> Added: grass/branches/releasebranch_7_2/raster/r.to.vect/set_error_handler.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.to.vect/set_error_handler.c (rev 0)
> +++ grass/branches/releasebranch_7_2/raster/r.to.vect/set_error_handler.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -0,0 +1,33 @@
> +#include <grass/gis.h>
> +#include <grass/vector.h>
> +
> +struct handler_input
> +{
> + struct Map_info *Map;
> + dbDriver **driver;
> +};
> +
> +static void error_handler(void *p)
> +{
> + const struct handler_input *input = (const struct handler_input *)p;
> +
> + if (input->driver && *input->driver)
> + db_close_database_shutdown_driver(*input->driver);
> + if (input->Map) {
> + char *name = G_store(input->Map->name);
> + if (input->Map->open == VECT_OPEN_CODE)
> + Vect_close(input->Map);
> + Vect_delete(name);
> + G_free(name);
> + }
> +}
> +
> +void set_error_handler(struct Map_info *Map, dbDriver **driver)
> +{
> + struct handler_input *input = G_malloc(sizeof(struct handler_input));
> +
> + input->Map = Map;
> + input->driver = driver;
> +
> + G_add_error_handler(error_handler, input);
> +}
>
> Modified: grass/branches/releasebranch_7_2/raster/r.topidx/r.topidx.html
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.topidx/r.topidx.html 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/raster/r.topidx/r.topidx.html 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -23,7 +23,7 @@
> <a href="r.mapcalc.html">r.mapcalc</a>
> </em>
> <br>
> -<a href="http://idea.isnew.info/r.topidx">Known issues</a>
> +<a href="http://idea.isnew.info/r.topidx.html">Known issues</a>
>
> <h2>REFERENCES</h2>
>
>
> Modified: grass/branches/releasebranch_7_2/raster/r.topmodel/r.topmodel.html
> ===================================================================
> --- grass/branches/releasebranch_7_2/raster/r.topmodel/r.topmodel.html 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/raster/r.topmodel/r.topmodel.html 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -152,7 +152,7 @@
> <a href="r.topidx.html">r.topidx</a>
> </em>
> <br>
> -<a href="http://idea.isnew.info/r.topmodel">How to run r.topmodel</a>
> +<a href="http://idea.isnew.info/r.topmodel.html">How to run r.topmodel</a>
>
>
> <h2>AUTHORS</h2>
>
> Modified: grass/branches/releasebranch_7_2/scripts/v.db.addtable/v.db.addtable.py
> ===================================================================
> --- grass/branches/releasebranch_7_2/scripts/v.db.addtable/v.db.addtable.py 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/scripts/v.db.addtable/v.db.addtable.py 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -86,7 +86,7 @@
> grass.verbose(_("Using user specified table name: %s") % table)
>
> # check if DB parameters are set, and if not set them.
> - grass.run_command('db.connect', flags='c')
> + grass.run_command('db.connect', flags='c', quiet=True)
> grass.verbose(_("Creating new DB connection based on default mapset settings..."))
> kv = grass.db_connection()
> database = kv['database']
> @@ -106,15 +106,21 @@
> stderr=nuldev)
>
> if not table in tables.splitlines():
> + colnames = []
> if columns:
> - column_def = [x.strip().lower() for x in columns.strip().split(',')]
> + column_def = []
> + for x in ' '.join(columns.lower().split()).split(','):
> + colname = x.split()[0]
> + if colname in colnames:
> + grass.fatal(_("Duplicate column name '%s' not allowed") % colname)
> + colnames.append(colname)
> + column_def.append(x)
> else:
> column_def = []
>
> # if not existing, create it:
> - column_def_key = "%s integer" % key
> - if column_def_key not in column_def:
> - column_def.insert(0, column_def_key)
> + if not key in colnames:
> + column_def.insert(0, "%s integer" % key)
> column_def = ','.join(column_def)
>
> grass.verbose(_("Creating table with columns (%s)...") % column_def)
> @@ -133,10 +139,17 @@
> map=map_name, database=database, driver=driver,
> layer=layer, table=table, key=key)
>
> - # finally we have to add cats into the attribute DB to make modules such as v.what.rast happy:
> - # (creates new row for each vector line):
> - grass.run_command('v.to.db', map=map_name, layer=layer,
> - option='cat', column=key, qlayer=layer)
> + # finally we have to add cats into the attribute DB to make
> + # modules such as v.what.rast happy: (creates new row for each
> + # vector line):
> + try:
> + grass.run_command('v.to.db', map=map_name, layer=layer,
> + option='cat', column=key, qlayer=layer)
> + except CalledModuleError:
> + # remove link
> + grass.run_command('v.db.connect', quiet=True, flags='d',
> + map=map_name, layer=layer)
> + return 1
>
> grass.verbose(_("Current attribute table links:"))
> if grass.verbosity() > 2:
>
> Modified: grass/branches/releasebranch_7_2/vector/v.build.polylines/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.build.polylines/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.build.polylines/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -97,7 +97,6 @@
>
> int polyline;
> int *lines_visited;
> - int points_in_polyline;
> int start_line;
> int nlines;
> int write_cats, copy_tables;
> @@ -177,8 +176,10 @@
> write_cats = NO_CATS;
> else if (strcmp(cats->answer, "first") == 0)
> write_cats = ONE_CAT;
> - else
> + else if (strcmp(cats->answer, "multi") == 0)
> write_cats = MULTI_CATS;
> + else
> + write_cats = SAME_CATS;
>
> if (type_opt->answer)
> type = Vect_option_to_types(type_opt);
> @@ -218,9 +219,8 @@
> G_debug(1, "Polyline %d: start line = %d", polyline, start_line);
>
> /* Walk forward and pick up coordinates */
> - points_in_polyline =
> - walk_forward_and_pick_up_coords(&map, start_line, ltype, points,
> - lines_visited, Cats, write_cats);
> + walk_forward_and_pick_up_coords(&map, start_line, ltype, points,
> + lines_visited, Cats, write_cats);
>
> /* Write the line (type of the first line is used) */
> Vect_write_line(&Out, ltype, points, Cats);
> @@ -230,12 +230,10 @@
>
> G_verbose_message(n_("%d line or boundaries found in input vector map",
> "%d lines or boundaries found in input vector map",
> - nlines),
> - nlines, Vect_get_name(&map), Vect_get_mapset(&map));
> + nlines), nlines);
> G_verbose_message(n_("%d polyline stored in output vector map",
> "%d polylines stored in output vector map",
> - polyline),
> - polyline, Vect_get_name(&Out), Vect_get_mapset(&Out));
> + polyline), polyline);
>
> /* Copy (all linked) tables if needed */
> if (copy_tables) {
>
> Modified: grass/branches/releasebranch_7_2/vector/v.build.polylines/walk.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.build.polylines/walk.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.build.polylines/walk.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -129,7 +129,7 @@
> {
> int cat_idx;
> int line, next_line, n1, n2;
> - int type, node, next_node;
> + int node, next_node;
> struct line_pnts *pnts;
> struct line_cats *cats_tmp;
>
> @@ -149,9 +149,9 @@
> /* Pick up first set of coordinates */
> lines_visited[line] = 1;
> if (cats_tmp)
> - type = Vect_read_line(map, pnts, Cats, line);
> + Vect_read_line(map, pnts, Cats, line);
> else
> - type = Vect_read_line(map, pnts, NULL, line);
> + Vect_read_line(map, pnts, NULL, line);
>
> Vect_get_line_nodes(map, line, &n1, &n2);
> next_line = find_next_line(map, line, n1, ltype);
> @@ -175,7 +175,7 @@
> node = next_node;
> while (line != 0 && line != start_line) {
> G_debug(2, " line = %d", line);
> - type = Vect_read_line(map, pnts, cats_tmp, line);
> + Vect_read_line(map, pnts, cats_tmp, line);
> if (cats_tmp && write_cats == MULTI_CATS) {
> for (cat_idx = 0; cat_idx < cats_tmp->n_cats; cat_idx++) {
> Vect_cat_set(Cats, cats_tmp->field[cat_idx],
>
> Modified: grass/branches/releasebranch_7_2/vector/v.distance/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.distance/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.distance/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -286,6 +286,10 @@
> Upload[i].upload = TO_ATTR;
> }
>
> + /* store default column names if column= is not given */
> + if (!opt.column->answer)
> + Upload[i].column = G_store(opt.upload->answers[i]);
> +
> i++;
> }
> Upload[i].upload = END;
> @@ -625,8 +629,12 @@
> }
>
> /* Go through all lines in 'from' and find nearest in 'to' for each */
> - /* Note: as from_type is restricted to GV_POINTS (for now) everything is simple */
> + /* Note: as from_type is restricted to GV_POINTS (for now) everything is
> + * simple */
>
> + /* suppress compiler warnings */
> + tx = ty = tz = fx = fy = fz = 0;
> +
> count = 0; /* count of distances in 'do_all' mode */
> /* Find nearest features for 'from' lines */
> if (nfromlines) {
> @@ -1388,7 +1396,7 @@
> G_percent(i, count, 1);
>
> /* Write line connecting nearest points */
> - if (Outp != NULL) {
> + if (Near[i].count > 0 && Outp != NULL) {
> Vect_reset_line(FPoints);
> Vect_reset_cats(FCats);
>
>
> Modified: grass/branches/releasebranch_7_2/vector/v.distance/v.distance.html
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.distance/v.distance.html 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.distance/v.distance.html 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -97,7 +97,7 @@
> needed for network analysis:
>
> <div class="code"><pre>
> -v.distance -p from=pnt to=ln out=connections upload=dist column=dist
> +v.distance from=pnt to=ln out=connections upload=dist column=dist
> </pre></div>
>
> <h3>Query information</h3>
> @@ -116,7 +116,7 @@
> Find nearest features:
>
> <div class="code"><pre>
> -v.distance from=pnt to=map_to_query upload=cat col=somecol -p
> +v.distance -p from=pnt to=map_to_query upload=cat
> </pre></div>
>
> <h3>Point-in-polygon</h3>
> @@ -174,7 +174,7 @@
> echo "0|-58|1" | v.in.ascii output=pnt2 input=-
>
> # here, distances is in degree units
> -v.distance from=pnt1 to=pnt2 upload=dist col=distance -p --q
> +v.distance -p --q from=pnt1 to=pnt2 upload=dist
> from_cat|distance
> 1|3
> </pre></div>
> @@ -186,15 +186,14 @@
> <p>
> Spearfish sample data location:
> <div class="code"><pre>
> -v.distance -pa from=archsites to=archsites upload=dist col=dist
> +v.distance -pa from=archsites to=archsites upload=dist
> </pre></div>
>
> <p>
> North Carolina sample data location:
>
> <div class="code"><pre>
> -v.distance -pa from=hospitals to=hospitals upload=dist \
> - col=dist separator=comma
> +v.distance -pa from=hospitals to=hospitals upload=dist separator=tab
> from_cat to_cat dist
> 1 2 3 4 5 ...
> 1 0 7489.10 339112.17 70900.39 70406.23 ...
>
> Modified: grass/branches/releasebranch_7_2/vector/v.edit/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.edit/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.edit/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -8,7 +8,7 @@
> * Jachym Cepicky
> * Major updates by Martin Landa <landa.martin gmail.com>
> *
> - * COPYRIGHT: (C) 2006-2014 by the GRASS Development Team
> + * COPYRIGHT: (C) 2006-2017 by the GRASS Development Team
> *
> * This program is free software under the GNU General
> * Public License (>=v2). Read the file COPYING that comes
>
> Modified: grass/branches/releasebranch_7_2/vector/v.edit/max_distance.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.edit/max_distance.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.edit/max_distance.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -39,6 +39,8 @@
> if (maxdistance < 0.0) {
> G_get_window(&window);
>
> + G_begin_distance_calculations();
> +
> ew_dist1 =
> G_distance(window.east, window.north, window.west, window.north);
> /* EW Dist at South Edge */
>
> Modified: grass/branches/releasebranch_7_2/vector/v.patch/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.patch/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.patch/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -413,8 +413,11 @@
> Vect_set_map_name(&OutMap, "Output from v.patch");
> Vect_set_person(&OutMap, G_whoami());
>
> - if (!no_topo->answer)
> + if (!no_topo->answer) {
> + if (append->answer)
> + Vect_build_partial(&OutMap, GV_BUILD_NONE);
> Vect_build(&OutMap);
> + }
> Vect_close(&OutMap);
>
> if (bbox_name) {
>
> Modified: grass/branches/releasebranch_7_2/vector/v.select/copy_tabs.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.select/copy_tabs.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.select/copy_tabs.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -55,12 +55,17 @@
> OFi =
> Vect_default_field_info(Out, IFi->number, IFi->name, ttype);
>
> - ret =
> - db_copy_table_by_ints(IFi->driver, IFi->database, IFi->table,
> - OFi->driver,
> - Vect_subst_var(OFi->database, Out),
> - OFi->table, IFi->key, cats[i],
> - ncats[i]);
> + if (ncats[i] > 0)
> + ret = db_copy_table_by_ints(IFi->driver, IFi->database, IFi->table,
> + OFi->driver,
> + Vect_subst_var(OFi->database, Out),
> + OFi->table, IFi->key, cats[i],
> + ncats[i]);
> + else
> + ret = db_copy_table_where(IFi->driver, IFi->database, IFi->table,
> + OFi->driver,
> + Vect_subst_var(OFi->database, Out),
> + OFi->table, "0 = 1");
>
> if (ret == DB_FAILED) {
> G_warning(_("Unable to copy table for layer %d"), fields[i]);
>
> Modified: grass/branches/releasebranch_7_2/vector/v.select/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.select/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.select/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -7,7 +7,7 @@
> * Markus Neteler <neteler itc.it>
> * Martin Landa <landa.martin gmail.com> (GEOS support)
> * PURPOSE: Select features from one map by features in another map.
> - * COPYRIGHT: (C) 2003-2014 by the GRASS Development Team
> + * COPYRIGHT: (C) 2003-2017 by the GRASS Development Team
> *
> * This program is free software under the GNU General
> * Public License (>=v2). Read the file COPYING that
>
> Modified: grass/branches/releasebranch_7_2/vector/v.to.db/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.to.db/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.to.db/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -68,7 +68,7 @@
> }
>
> /* allocate array for values */
> - /* (+ 1 is for cat -1 (no category) reported at the end ) */
> + /* (+1 is for cat -1 (no category) reported at the end ) */
> findex = Vect_cidx_get_field_index(&Map, options.field);
> if (findex > -1) {
> n = Vect_cidx_get_num_unique_cats_by_index(&Map, findex);
> @@ -80,7 +80,8 @@
> Values = (struct value *) G_calloc(n + 1, sizeof(struct value));
>
> /* prepopulate Values */
> - n = Vect_cidx_get_num_cats_by_index(&Map, findex);
> + if (findex > -1)
> + n = Vect_cidx_get_num_cats_by_index(&Map, findex);
> i = 0;
> Values[i].cat = -1; /* features without category */
> Values[i].used = 0;
>
> Modified: grass/branches/releasebranch_7_2/vector/v.to.points/write.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.to.points/write.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.to.points/write.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -84,7 +84,7 @@
> len = hypot(hypot(dx, dy), dz);
>
> /* interpolate segment */
> - if (interpolate && vert < (LPoints->n_points - 1)) {
> + if (vertex == GV_VERTEX && interpolate) {
> int i, n;
> double x, y, z, dlen;
>
>
> Modified: grass/branches/releasebranch_7_2/vector/v.what/main.c
> ===================================================================
> --- grass/branches/releasebranch_7_2/vector/v.what/main.c 2017-03-01 11:35:50 UTC (rev 70709)
> +++ grass/branches/releasebranch_7_2/vector/v.what/main.c 2017-03-01 11:45:44 UTC (rev 70710)
> @@ -134,6 +134,7 @@
> x = window.proj;
> G_format_resolution(window.ew_res, ewres, x);
> G_format_resolution(window.ns_res, nsres, x);
> + G_begin_distance_calculations();
> EW_DIST1 =
> G_distance(window.east, window.north, window.west, window.north);
> /* EW Dist at South Edge */
>
> _______________________________________________
> grass-commit mailing list
> grass-commit at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/grass-commit
--
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
More information about the grass-dev
mailing list