Selaa lähdekoodia

v.distance: tell user if input is 3D (esp. relevant for v.what.vect)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@66427 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 9 vuotta sitten
vanhempi
commit
b0795e9517

+ 2 - 0
scripts/v.what.vect/v.what.vect.html

@@ -17,6 +17,8 @@ category number falls into different <b>query_map</b> polygons.
 <p>When transferring attributes from a point map to a polygon map, usually <b>dmax</b>
 has to be larger than zero (determined by distance between query points and
 polygon centroids).
+<p>In case that one or both input vector maps are 3D, features need to touch also
+in the 3rd dimension (z coordinate) in order to transfer attributes.
 
 <h2>EXAMPLES</h2>
 

+ 6 - 0
vector/v.distance/main.c

@@ -310,6 +310,9 @@ int main(int argc, char *argv[])
 	G_fatal_error(_("Unable to open vector map <%s>"), opt.from->answer);
 
     from_field = Vect_get_field_number(&From, opt.from_field->answer);
+    /* in 3D features may not be found */
+    if (Vect_is_3d(&From))
+        G_warning(_("Input vector map <%s> is 3D"), opt.from->answer);
 
     nfromlines = Vect_get_num_primitives(&From, from_type);
     nfromareas = 0;
@@ -327,6 +330,9 @@ int main(int argc, char *argv[])
     Vect_set_open_level(2);
     if (Vect_open_old2(&To, opt.to->answer, "", opt.to_field->answer) < 0)
 	G_fatal_error(_("Unable to open vector map <%s>"), opt.to->answer);
+    /* in 3D features may not be found */
+    if (Vect_is_3d(&To))
+        G_warning(_("Input vector map <%s> is 3D"), opt.to->answer);
 
     ntolines = Vect_get_num_primitives(&To, to_type);
     ntoareas = 0;

+ 5 - 0
vector/v.distance/v.distance.html

@@ -50,6 +50,7 @@ the distance is then set to zero and no further tests are done.
 
 If a nearest feature does not have a category, the attribute column is 
 updated to NULL.
+
 <p>The upload <b>column</b>(s) must already exist. Create one with 
 <em><a href="v.db.addcolumn.html">v.db.addcolumn</a></em>.
 
@@ -57,6 +58,10 @@ updated to NULL.
 (<em>dist</em>, <em>from_along</em>, and <em>to_along</em>) not in 
 degrees but in meters calculated as geodesic distances on a sphere.
 
+<p>
+If one or both of the input vector maps are 3D, the user is notified
+accordingly.
+
 <h2>EXAMPLES</h2>
 
 <h3>Find nearest lines</h3>