Connect_info - ObjectVision/GeoDMS GitHub Wiki
Network functions connect_info
syntax
- connect_info(arcs, points, [optional] maxSqrDist)
definition
The connect_info(arcs, points) function is used to get information for each entry in the domain unit of attribute points on how the connect function (second variant) results in a connection to the attribute arcs.
The connect_info has the same arguments as the connect function.
The connect_info results in a container with a set of attributes for the same domain unit as the points.
The result contains the following attributes:
- dist: the distance between the point from the points and the CutPoint on the arc/polygon outline from the arcs;
- ArcID: the relation for each entry of the domain unit of the points to the connected arc of the arcs domain unit;
- CutPoint: The coordinate of the connection point on the arcs;
- InArc: true if the CutPoint is not the first or last point;
- InSegm: true if the CutPoint is not an (intermediate or final) point of the sequence of points;
- SegmID: the id of the segment in the arc to which the point is connected.
description
The arcs should contain unique geometries. Use the unique function to make a domain unit with unique geometries.
applies to
- data items arcs and points with fpoint or dpoint value type
- data item arcs with composition type arc or polygon. Be aware, 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.
conditions
The value type of arcs and points must match.
performance
O(n * log m + n * k) where n = number of points, m = number of arc segments, and k = average segments per geometry. Same complexity as connect variant 2, but returns detailed connection information instead of new geometry.
example
container location2road := connect_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 | ArcID | CutPoint | InArc | InSegm | SegmID |
|---|---|---|---|---|---|
| 79.42 | 2 | xy(114824; 398603) | True | True | 0 |
| 131.00 | 1 | xy(111872; 398688) | True | True | 0 |
| 63.09 | 0 | xy(112560; 399186) | True | True | 0 |
| 56.51 | 2 | xy(114847; 399291) | True | True | 0 |
| 119.52 | 1 | xy(111922; 399468) | True | True | 0 |
| 220.47 | 2 | xy(114915; 401338) | True | True | 0 |
| 180.79 | 1 | xy(111531; 401760) | True | True | 1 |
| 610.40 | 1 | xy(111555; 401625) | True | True | 1 |
domain location, nr of rows = 8