Przeglądaj źródła

update vectorintro

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@56887 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 12 lat temu
rodzic
commit
7db53ca876

+ 2 - 0
vector/Makefile

@@ -27,6 +27,7 @@ SUBDIRS = \
 	v.in.ascii \
 	v.in.db \
 	v.in.dxf \
+	v.in.ply \
 	v.in.region \
 	v.in.sites \
 	v.kcv \
@@ -58,6 +59,7 @@ SUBDIRS = \
 	v.normal \
 	v.out.ascii \
 	v.out.dxf \
+	v.out.ply \
 	v.out.postgis \
 	v.out.pov \
 	v.out.svg \

+ 2 - 2
vector/v.net.salesman/Makefile

@@ -3,8 +3,8 @@ MODULE_TOPDIR = ../..
 
 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)
 

+ 7 - 8
vector/v.net.salesman/main.c

@@ -231,21 +231,20 @@ int main(int argc, char **argv)
 	    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)"));
 

+ 12 - 0
vector/v.voronoi/sw_geometry.c

@@ -117,6 +117,17 @@ int right_of(struct Halfedge *el, struct Point *p)
 	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 @@ int right_of(struct Halfedge *el, struct Point *p)
 	    if (e->b < 0.0)
 		above = !above;
 	}
+#endif
     }
     else {			/*e->b==1.0 */
 	yl = e->c - e->a * p->x;

+ 11 - 11
vector/vectorintro.html

@@ -58,10 +58,10 @@ components in a single vector map are related. For example in a
 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 @@ approximation and topographic analysis from a point or isoline file.
 <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 @@ Adjacent polygons can be found by <a href="v.to.db.html">v.to.db</a>
 <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 @@ To bulk process attributes, it is recommended to use SQL
 <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