1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
|
<H2>DESCRIPTION</H2>
<EM>v.distance</EM>
finds features from one vector (from=) feature to another vector (to=) nearest feature.
Various information about relation (distance, ...) may be uploaded to attribute
table attached to first vector map or printed to 'stdout'.
A new vector map may be created where lines connecting nearest points on features are written.
<P>
<h2>EXAMPLES</H2>
1) Find <B>nearest lines</B> in vector map <B>ln</B> for points from vector map
<B>pnt</B> within the given threshold and write related line categories to
column <B>linecat</B> in attribute table attached to vector map <B>pnt</B>:
<br>
<tt>v.distance from=pnt to=ln upload=cat column=linecat</tt>
<p>
2) For each point from vector map <B>pnt</B> find <B>nearest area</B> from map
<B>ar</B> within the given threshold and write the related area categories
to column <B>areacat</B> in attribute table attached to vector map
<B>pnt</B>. In case a point falls into a polygon area, the distance is zero:
<br>
<tt>v.distance from=pnt to=ar upload=cat column=areacat</tt>
<p>
3) Create a new vector map which contains <B>lines connecting nearest
features</B> of maps <B>pnt</B> and map <B>ln</B>. The resulting vector map
can be used for example to connect points to a network as needed for
network analysis:
<br>
<tt>v.distance -p from=pnt to=ln out=connections upload=dist column=dist</tt>
<p>
4) Query information from selected point(s). v.distance takes points from
vector as input instead of stdin. First new vector map with query points,
has to be created, then the map can be analysed:
<br>
Create query map (if not present):<br>
<tt>echo "123456|654321|1" | v.in.ascii output=pnt</tt>
<br>
Find nearest features:<br>
<tt>v.distance from=pnt to=map_to_query upload=cat col=somecol -p</tt>
<p>
5) Point-in-polygon: Find <B>area</B> from vector map <B>ar</B> for each point
from vector map <B>pnt</B> in which the individual point falls into and write
the related area categories to column <B>areacat</B> into attribute table
attached to vector map <B>pnt</B>:
<br>
<tt>v.distance from=pnt to=ar max=0 upload=cat column=areacat</tt>
<H2>NOTES</H2>
If a nearest feature does not have a category, column is updated to <B>null</B>.
This is true also for areas, which means for example, that if point is in island
(area WITHOUT category), v.distance does not search for nearest area WITH category,
island is identified as nearest and category updated to null.
<H2>SEE ALSO</H2>
<EM><a href="r.distance.html">r.distance</a></EM>
<H2>AUTHOR</H2>
Janne Soimasuo 1994, Finland<br>
University of Joensuu, Faculty of Forestry, Finland
<p>
5.0 cmd line coordinates support: Markus Neteler, ITC-irst, Trento, Italy<BR>
<p>
5.1 update Radim Blazek, ITC-irst, Trento, Italy
<p><i>Last changed: $Date: 2004/03/16 14:47:22 $</i>
|