dist_info - ObjectVision/GeoDMS GitHub Wiki
Network functions dist_info
- dist_info(arcs, points, [optional] maxSqrDist)
- dist_info(points, arcs, [optional] maxSqrDist)
The dist_info(arcs, points) function is used to get the distance between the point from the points and the CutPoint on the arc/polygon outline from the arcs. This is the same as the dist attribute from the connect_info function.
Since GeoDMS 20.19.2 the two geometry arguments may be given in the other order: dist_info(points, arcs) results in an attribute of the domain unit of the arcs, holding for each arc the distance to the nearest of the points. This is the same as the dist attribute of the reversed connect_info; see that page for what the reversed order means and for the domain unit of the optional maxSqrDist. An arc for which no point qualifies gets the maximum float value.
The arcs should contain unique geometries. Use the unique function to make a domain unit with unique geometries.
- data items arcs and points with fpoint or dpoint value type
- data item arcs with composition type arc or polygon. Be aware that if you connect points to polygons, use a split_polygon to avoid connecting to segments that separate different rings (lakes or islands) in a polygon.
The values type of arcs and points must match.
attribute<float32> dist2road (location) := dist_info(road/geometry, location/geometry);
| road/geometry |
|---|
| {2: xy(112631; 399246) xy(111866; 398599)} |
| {3: xy(111866; 398599) xy(111924; 399495) xy(111524; 401801)} |
| {2: xy(114921; 401529) xy(114823; 398584)} |
domain road, nr of rows = 3
| location/geometry |
|---|
| xy(114903; 398600) |
| xy(111741; 398696) |
| xy(112601; 399138) |
| xy(114903; 399289) |
| xy(111803; 399476) |
| xy(115135; 401331) |
| xy(111353; 401729) |
| xy(112156; 401729) |
domain location, nr of rows = 8
| dist |
|---|
| 79.42 |
| 131.00 |
| 63.09 |
| 56.51 |
| 119.52 |
| 220.47 |
| 180.79 |
| 610.40 |
domain location, nr of rows = 8