Arc2segm - ObjectVision/GeoDMS GitHub Wiki

Geometric functions arc2segm(ent)

syntax

  • arc2segm(arc_polygon_dataitem)

definition

arc2segm(arc_polygon_dataitem) divides an arc or polygon data item arc_polygon_dataitem into segments.

The function results in a new domain unit with three subitems:

  1. point: a point data item with the first point of each segment;
  2. nextpoint: a point data item with the last point of each segment.
  3. sequence_rel: relation to the arc_polygon_dataitem

description

The arc2segm function is used to split an arc geometry into intermediates that become nodes in a network. This operator can also be applied to polygons; however, when the set includes lakes, it generates "lines" for the connecting lines.

applies to

data item arc_polygon_dataitem with fpoint or dpoint value type and composition type arc or polygon.

performance

O(n) where n = total number of points across all arcs/polygons. Single pass creating one segment for each pair of consecutive points.

example

unit<uint32> segments := arc2segm(road/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

point nextpoint sequence_rel
xy(112631; 399246) xy(111866; 398599) 0
xy(111866; 398599) xy(111924; 399495) 1
xy(111924; 399495) xy(111524; 401801) 1
xy(114921; 401529) xy(114823; 398584) 2

domain segments, nr of rows = 4

⚠️ **GitHub.com Fallback** ⚠️