Dyna_segment

Geometric functions dyna_segment

syntax

  • dyna_segment(startpoint, endpoint, distance)
  • dyna_segment_with_ends(startpoint, endpoint, distance)

definition

  • dyna_segment(startpoint, endpoint, distance) results in a new Domain unit, with four generated subitems (see description) :
  1. point: the generated first Point data items of the Segment
  2. NextPoint: the generated last point data items of the segment
  3. sequence_rel: the relation between each point and its segment.
  4. ordinal: the order of the points in each segment.

Since GeoDMS 18.0.2 the relation is only available as sequence_rel; up to 18.0.1 it could also be referred to as SequenceNr, which now fails with Unknown identifier. See Sequence2points, which generates the same relation.

The dyna_segment function results in a set of entries with the segments generated by the dyna_segment function. The number of rows of the dyna_segment is 1 less than the Dyna_point function.

Points are generated at segments, configured by the startpoint and nextpoint data items. In the figure above the light green lines are the segments, the dark green dots the dyna_segments.

The distance between the points is configured with the distance Parameter or literal.

The dyna_segment_with_ends functions like the dyna_segment function, only the end coordinates are always added to the resulting attributes.

Since GeoDMS 20.23.1 the first generated segment on an input segment that connects to the previous one starts at the end point that dyna_segment_with_ends added for that previous segment. Before, it started at the last point sampled before that end point, so it ran across the end point and was longer than the distance: for (0,0)-(0,10) followed by (0,10)-(0,20) with distance 3, the fifth segment ran from 9 to 13 instead of from 10 to 13. dyna_segment without ends, and input segments that do not connect, give the same result as before.

applies to

  • startpoint and endpoint data items with fpoint or dpoint Value type
  • literal or parameter dist with float32 or float64 value type

conditions

The domain unit and Values unit of the startpoint and endpoint arguments must match.

performance

O(n + r) where n = number of input segments and r = total number of generated sub-segments. Output size depends on segment lengths and distance parameter.

see also

example

unit<uint32> CalcSegment := dyna_segment(startpoint, endpoint, 5f);
startpoint endpoint
xy(371391; 13732) xy(371384; 13738)
xy(371384; 13738) xy(371378; 13746)
xy(371378; 13746) xy(371369; 13758)
xy(371369; 13758) xy(371364; 13764)
xy(371364; 13764) xy(371360; 13768)

domain Segment, nr of rows = 5

point NextPoint sequence_rel ordinal
{13735.3, 371387} xy(371391; 13732) 0 0
{13738.6, 371384} {13735.3, 371387} 1 0
{13742.6, 371381} {13738.6, 371384} 1 1
{13746.6, 371378} {13742.6, 371378} 2 0
{13750.6, 371375} {13746.6, 371378} 2 1
{13754.6, 371372} {13750.6, 371375} 2 2
{13758.6, 371369} {13754.6, 371372} 3 0
{13762.4, 371365} {13758.6, 371369} 3 1
{13766.1, 371362} {13762.4, 371365} 4 0

domain CalcSegment, nr of rows = 9