[GRASS-SVN] r71038 - in grass/branches/releasebranch_7_2: lib/vector/Vlib vector/v.out.postgis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat May 6 02:15:35 PDT 2017
Author: martinl
Date: 2017-05-06 02:15:35 -0700 (Sat, 06 May 2017)
New Revision: 71038
Modified:
grass/branches/releasebranch_7_2/lib/vector/Vlib/build.c
grass/branches/releasebranch_7_2/lib/vector/Vlib/copy.c
grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c
Log:
v.out.postgis: do not print build info when exporting simple features
vlib: skip build message when using PostGIS Topology (cosmetics)
vlib: fix copying centroids when using PostGIS Topology (see 'v.out.postgis -l')
(merge r70975:70977 from trunk)
Modified: grass/branches/releasebranch_7_2/lib/vector/Vlib/build.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/vector/Vlib/build.c 2017-05-06 09:11:40 UTC (rev 71037)
+++ grass/branches/releasebranch_7_2/lib/vector/Vlib/build.c 2017-05-06 09:15:35 UTC (rev 71038)
@@ -867,7 +867,7 @@
}
plus = &(Map->plus);
- if (build > GV_BUILD_NONE && !Map->temporary) {
+ if (build > GV_BUILD_NONE && !Map->temporary && Map->format != GV_FORMAT_POSTGIS) {
G_message(_("Building topology for vector map <%s>..."),
Vect_get_full_name(Map));
}
Modified: grass/branches/releasebranch_7_2/lib/vector/Vlib/copy.c
===================================================================
--- grass/branches/releasebranch_7_2/lib/vector/Vlib/copy.c 2017-05-06 09:11:40 UTC (rev 71037)
+++ grass/branches/releasebranch_7_2/lib/vector/Vlib/copy.c 2017-05-06 09:15:35 UTC (rev 71038)
@@ -94,10 +94,8 @@
/* get type of first feature from input vector map */
Vect_rewind(In);
- Vect_set_constraint_type(In, GV_POINT | GV_LINES);
+ Vect_set_constraint_type(In, GV_POINTS | GV_LINES);
type = Vect_read_next_line(In, NULL, NULL);
- if (!(type & (GV_POINTS | GV_LINES)))
- G_fatal_error(_("Unsupported feature type %d"), type);
/* create feature table with given feature type */
if (0 > Vect_write_line(Out, type, NULL, NULL)) {
Modified: grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c 2017-05-06 09:11:40 UTC (rev 71037)
+++ grass/branches/releasebranch_7_2/vector/v.out.postgis/main.c 2017-05-06 09:15:35 UTC (rev 71038)
@@ -32,7 +32,7 @@
struct params params;
struct flags flags;
- int ret, field, otype;
+ int ret, field, otype, verbose;
char *schema, *olayer, *pg_file;
char *fid_column, *geom_column;
@@ -170,12 +170,18 @@
/* close input map */
Vect_close(&In);
- /* build topology for output map */
+ /* build topology for output map -> write output to DB */
+ G_message(_("Writing output..."));
+ verbose = G_verbose();
+ if (!flags.topo->answer)
+ G_set_verbose(0); /* do not print build info when writing simple features */
+
Vect_build_partial(&Out, GV_BUILD_NONE);
if (Vect_build(&Out) != 1)
G_fatal_error(_("Building %s topology failed"),
flags.topo->answer ? "PostGIS" : "pseudo");
-
+ G_set_verbose(verbose);
+
if (Vect_get_num_lines(&Out) < 1)
G_fatal_error(_("No features exported. PostGIS layer <%s> not created."),
Vect_get_name(&Out));
More information about the grass-commit
mailing list