[GRASS-SVN] r56887 - in grass/trunk/vector: . v.net.salesman v.voronoi

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jun 23 12:08:14 PDT 2013


Author: mmetz
Date: 2013-06-23 12:08:13 -0700 (Sun, 23 Jun 2013)
New Revision: 56887

Modified:
   grass/trunk/vector/Makefile
   grass/trunk/vector/v.net.salesman/Makefile
   grass/trunk/vector/v.net.salesman/main.c
   grass/trunk/vector/v.voronoi/sw_geometry.c
   grass/trunk/vector/vectorintro.html
Log:
update vectorintro

Modified: grass/trunk/vector/Makefile
===================================================================
--- grass/trunk/vector/Makefile	2013-06-23 18:39:23 UTC (rev 56886)
+++ grass/trunk/vector/Makefile	2013-06-23 19:08:13 UTC (rev 56887)
@@ -27,6 +27,7 @@
 	v.in.ascii \
 	v.in.db \
 	v.in.dxf \
+	v.in.ply \
 	v.in.region \
 	v.in.sites \
 	v.kcv \
@@ -58,6 +59,7 @@
 	v.normal \
 	v.out.ascii \
 	v.out.dxf \
+	v.out.ply \
 	v.out.postgis \
 	v.out.pov \
 	v.out.svg \

Modified: grass/trunk/vector/v.net.salesman/Makefile
===================================================================
--- grass/trunk/vector/v.net.salesman/Makefile	2013-06-23 18:39:23 UTC (rev 56886)
+++ grass/trunk/vector/v.net.salesman/Makefile	2013-06-23 19:08:13 UTC (rev 56887)
@@ -3,8 +3,8 @@
 
 PGM = v.net.salesman
 
-LIBES = $(VECTORLIB) $(GISLIB)
-DEPENDENCIES = $(VECTORDEP) $(GISDEP)
+LIBES = $(VECTORLIB) $(GRAPHLIB) $(GISLIB)
+DEPENDENCIES = $(VECTORDEP) $(GRAPHDEP) $(GISDEP)
 EXTRA_INC = $(VECT_INC)
 EXTRA_CFLAGS = $(VECT_CFLAGS)
 

Modified: grass/trunk/vector/v.net.salesman/main.c
===================================================================
--- grass/trunk/vector/v.net.salesman/main.c	2013-06-23 18:39:23 UTC (rev 56886)
+++ grass/trunk/vector/v.net.salesman/main.c	2013-06-23 19:08:13 UTC (rev 56887)
@@ -231,21 +231,20 @@
 	    continue;
 
 	Vect_read_line(&Map, Points, Cats, i);
-	node = Vect_find_node(&Map, Points->x[0], Points->y[0], Points->z[0], 0, 0);
-	if (!node) {
-	    G_warning(_("Point is not connected to the network"));
-	    continue;
-	}
 	if (!(Vect_cat_get(Cats, tfield, &cat)))
 	    continue;
 	if (Vect_cat_in_cat_list(cat, Clist)) {
-	    tsp_list_append(TList, node);
+	    node = Vect_find_node(&Map, Points->x[0], Points->y[0], Points->z[0], 0, 0);
+	    if (!node) {
+		G_warning(_("Point is not connected to the network"));
+	    }
+	    else
+		tsp_list_append(TList, node);
 	}
-	
     }
 
     ncities = TList->n_values;
-    G_message(_("Number of cities: [%d]"), ncities);
+    G_message(_("Number of cities: %d"), ncities);
     if (ncities < 2)
 	G_fatal_error(_("Not enough cities (< 2)"));
 

Modified: grass/trunk/vector/v.voronoi/sw_geometry.c
===================================================================
--- grass/trunk/vector/v.voronoi/sw_geometry.c	2013-06-23 18:39:23 UTC (rev 56886)
+++ grass/trunk/vector/v.voronoi/sw_geometry.c	2013-06-23 19:08:13 UTC (rev 56887)
@@ -117,6 +117,17 @@
 	return (0);
 
     if (e->a == 1.0) {
+	double xl = e->c - e->b * p->y;
+	t1 = p->x - xl;
+	t2 = p->y - topsite->coord.y;
+	t3 = xl - topsite->coord.x;
+	above = t1 * t1 > t2 * t2 + t3 * t3;
+#if 0
+	if (e->b < 0.0)
+	    above = !above;
+#endif
+
+#if 0
 	dyp = p->y - topsite->coord.y;
 	dxp = p->x - topsite->coord.x;
 	fast = 0;
@@ -138,6 +149,7 @@
 	    if (e->b < 0.0)
 		above = !above;
 	}
+#endif
     }
     else {			/*e->b==1.0 */
 	yl = e->c - e->a * p->x;

Modified: grass/trunk/vector/vectorintro.html
===================================================================
--- grass/trunk/vector/vectorintro.html	2013-06-23 18:39:23 UTC (rev 56886)
+++ grass/trunk/vector/vectorintro.html	2013-06-23 19:08:13 UTC (rev 56887)
@@ -58,10 +58,10 @@
 non-topological GIS if two areas shared a common border that border
 would be digitized two times and also stored in duplicate. In a
 topological GIS this border exists once and is shared between two
-areas.  Topological represenation of vector data helps to produce and
+areas.  Topological representation of vector data helps to produce and
 maintain vector maps with clean geometry as well as enables certain
 analyses that can not be conducted with non-topological or spaghetti
-data. In GRASS topological data are refered to as level 2 data and
+data. In GRASS, topological data are refered to as level 2 data and
 spaghetti data is referred to as level 1.
 <p>
 Sometimes topology is not necessary and the additional memory and
@@ -81,18 +81,18 @@
 <li> line: a directed sequence of connected vertices with two endpoints called nodes; </li>
 <li> boundary: the border line to describe an area; </li>
 <li> centroid: a point within a closed ring of boundaries; </li>
-<li> area: the topological composition of a closed ring of boundaries and optionally a centroid; </li>
+<li> area: the topological composition of a closed ring of boundaries and a centroid; </li>
 <li> face: a 3D area; </li>
 <li> kernel: a 3D centroid in a volume (not yet implemented); </li>
 <li> volume: a 3D corpus, the topological composition of faces and kernel (not yet implemented). </li>
 </ul>
 <p>
-Note that all lines and boundaries can be polylines (with vertices in between).
+Lines and boundaries can be composed of multiple vertices.
 <p>
 Area topology also holds information about isles. These isles are located
 within that area, not touching the boundaries of the outer area. Isles
-consist of one or more areas and are used internally to maintain correct
-topology for areas.
+are holes inside the area, can consist of one or more areas and are used 
+internally to maintain correct topology for areas.
 
 <p>
 The <a href="v.type.html">v.type</a> module can be used to convert
@@ -111,14 +111,14 @@
 <p>
 Many operations including extraction, queries, overlay, and export will
 only act on features which have been assigned a category number. Typically
-a centroid will hold the attribute data for the area between it and its
-boundaries. Boundaries are not typically given a category ID as it would be
+a centroid will hold the attribute data for the area with which the centroid is 
+associated. Boundaries are not typically given a category ID as it would be
 ambiguous as to which area either side of it the attribute data would belong
 to. An exception might be when the boundary between two crop-fields is the
 center-line of a road, and the category information is an index to the road
 name. For everyday use boundaries and centroids can be treated as internal
-data types and the user can work directly and more simply with the "area"
-meta-feature type.
+data types and the user can work directly and more simply with the "area" 
+type.
 
 
 <h3>Vector object categories and attribute management</h3>
@@ -224,7 +224,7 @@
 <h3>Geometry operations</h3>
 
 The module <a href="v.in.region.html">v.in.region</a> saves the
-current region boundary into a vector area.
+current region extents as a vector area.
 
 Split vector lines can be changes to polylines by
 <a href="v.build.polylines.html">v.build.polylines</a>. Long lines can be



More information about the grass-commit mailing list