logo-header

 
 

syntax

  1. connect(point_geom_dest, point_geom_org)
  2. connect(arc_geom, point_geom)

definition

The connect function has two variants:

  1. Both arguments are single point data items. This variant is used to find the nearest point. In this variant, the function results in the index number of the domain of the point_geom_dest attribute nearest to the point_geom_org location. The result is a data item for the domain unit of the point_geom_org item with as values unit the domain unit of the point_geom_dest data item.
  2. The first argument is an arc or polygon geometry data item. This variant is used to build a network typology. The points of the point_geom item are connected to the nearest location on the nearest destination arc/outline of the arc_geom item. For these cut points new nodes are added and existing links are split. The resulting item is a new domain unit with a UnionData subitem containing all links in the network and a nr_OrgEntity subitem with the index numbers of the original arcs (null for the new connections).

description

If the distance in the precision of the value type to the nearest point/arc/polygon occurs mutiple times, points are connected to the point/arc/polygon with the lowest index number.  

In both variants, the first argument should contain unique geometries. Use the unique function to make a domain unit with unique geometries.

The connect_info function can be used for the second variant to get more information on how the points are connected, e.g. the distance of each connection and the CutPoint on the connected arc.

applies to

Data items point_geom_dest, point_geom_org, arc_geom and point_geom with fpoint or dpoint value type

Data item arc_geom with composition type arc or polygon

conditions

The value type of all arguments must match.

since version

5.15

example

variant 1:
 attribute<Destination> Destination_rel (Origin) := 
connect(destination/geometry, origin/geometry);
origin/geometry   Destination_rel
{401331, 115135} 0
{399476, 111803} 1
{399289, 114903} 2
{401729, 111353} 3
{398696, 111741} 1
domain Origin, nr of rows = 5

destination/geometry
{401331, 115131}
{399138, 112601}
{398600, 114903}
{401729, 112156}
domain Destination, nr of rows = 4


variant 2:
unit<uint32> Location2Road := connect(road/geometry, location/geometry);
road/geometry
{2 {399246, 112631}{398599, 111866}}
{3 {398599, 111866}{399495, 111924} {401801, 111524}}
{2 {401529, 114921}{398584, 114823}}
domain Road, nr of rows = 3

location/geometry
{398600, 114903}
{398696, 111741}
{399138, 112601}
{399289, 114903}
{399476, 111803}
{401331, 115135}
{401729, 111353}
{401729, 112156}
domain Location, nr of rows = 8

Location2Road/UnionData
{2: {399246, 112631} {399186, 112560}}
{2: {398599, 111866} {398688, 111872}}
{2: {401529, 114921} {401338, 114915}}
{2: {398600, 114903} {398603, 114824}}
{2: {398696, 111741} {398688, 111872}}
{2: {399138, 112601} {399186, 112560}}
{2: {399289, 114903} {399291, 114847}}
{2: {399476, 111803} {399468, 111922}}
{2: {401331, 115135} {401338, 114915}}
{2: {401729, 111353} {401760, 111531}}
{2: {401729, 112156} {401625, 111555}}
{2: {398603, 114824} {398584, 114823}}
{2: {398688, 111872} {399468, 111922}}
{2: {399186, 112560} {398599, 111866}}
{2: {399291, 114847} {398603, 114824}}
{3: {399468, 111922} {399495, 111924} {401625, 111555}}
{2: {401338, 114915} {399291, 114847}}
{2: {401760, 111531} {401801, 111524}}
{2: {401625, 111555} {401760, 111531}}
domain Location2Road, nr of rows = 19

see also


OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904