[GRASS-SVN] r56510 - grass/trunk/lib/vector/Vlib
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu May 30 05:12:51 PDT 2013
Author: martinl
Date: 2013-05-30 05:12:50 -0700 (Thu, 30 May 2013)
New Revision: 56510
Modified:
grass/trunk/lib/vector/Vlib/build_pg.c
Log:
vlib(pg): fix updating topogeom data for faces
Modified: grass/trunk/lib/vector/Vlib/build_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_pg.c 2013-05-30 11:33:30 UTC (rev 56509)
+++ grass/trunk/lib/vector/Vlib/build_pg.c 2013-05-30 12:12:50 UTC (rev 56510)
@@ -314,6 +314,8 @@
if (pg_info->feature_type == SF_POLYGON) {
int centroid;
+ struct P_line *Line;
+
G_message(_("Updating TopoGeometry data..."));
for (area = 1; area <= plus->n_areas; area++) {
G_percent(area, plus->n_areas, 5);
@@ -321,8 +323,12 @@
if (centroid < 1)
continue;
+ Line = plus->Line[centroid];
+ if (!Line)
+ continue;
+
/* update topogeometry object: centroid -> face */
- if (build_topogeom_stmt(pg_info, GV_CENTROID, area, centroid, stmt) &&
+ if (build_topogeom_stmt(pg_info, GV_CENTROID, area, (int) Line->offset, stmt) &&
Vect__execute_pg(pg_info->conn, stmt) == -1) {
Vect__execute_pg(pg_info->conn, "ROLLBACK");
return 0;
More information about the grass-commit
mailing list