Skip to content

Points2sequence

Maarten Hilferink edited this page Sep 27, 2026 · 17 revisions

Geometric functions points2sequence

syntax

  • points2sequence(point)
  • points2sequence(point, Sequence_rel)
  • points2sequence(point, Sequence_rel, ordinal)
  • points2sequence_p(point)
  • points2sequence_ps(point, Sequence_rel)
  • points2sequence_pso(point, Sequence_rel, ordinal)
  • points2sequence_po(point, ordinal)
  • points2arc(point)
  • points2arc(point, Sequence_rel)
  • points2arc(point, Sequence_rel, ordinal)
  • points2arc_p(point)
  • points2arc_ps(point, Sequence_rel)
  • points2arc_pso(point, Sequence_rel, ordinal)
  • points2arc_po(point, ordinal)
  • points2polygon(point)
  • points2polygon(point, Sequence_rel)
  • points2polygon(point, Sequence_rel, ordinal)
  • points2polygon_p(point)
  • points2polygon_ps(point, Sequence_rel)
  • points2polygon_pso(point, Sequence_rel, ordinal)
  • points2polygon_po(point, ordinal)
  • points2multi_point(point)
  • points2multi_point(point, Sequence_rel)
  • points2multi_point(point, Sequence_rel, ordinal)
  • points2multi_point_p(point)
  • points2multi_point_ps(point, Sequence_rel)
  • points2multi_point_pso(point, Sequence_rel, ordinal)
  • points2multi_point_po(point, ordinal)

definition

  • points2sequence(point, Sequence_rel, ordinal) and its variants result in a point attribute with composition type arc.
  • points2arc(point, Sequence_rel, ordinal) and its variants are a feature-type-named alias of points2sequence; they also result in a point attribute with composition type arc.
  • points2polygon(point, Sequence_rel, ordinal) and its variants result in a point attribute with composition type polygon.
  • points2multi_point(point, Sequence_rel, ordinal) and its variants result in a point attribute with composition type multipoint.

All four function groups are used to make arcs, polygons or multipoints, based on a data item with points, a relation from the point towards the domain unit of the resulting geometries and a data item indicating the order of the points in the resulting geometries. They differ only in the composition type of the result.

The _ps and _po suffixes disambiguate a two-argument call: _ps reads the second argument as Sequence_rel, _po reads it as ordinal. The base (unsuffixed) group accepts one, two or three arguments, and reads a second argument as Sequence_rel.

They all have the following arguments:

  • point = a data item with the points for the resulting arcs/polygons.
  • Sequence_rel = an optional relation towards the domain unit of the resulting arcs/polygons. If no Sequence_rel is configured, the resulting data item with arc/polygons is a parameter.
  • ordinal = an optional data item with the order of each point in the resulting arcs/polygons. If no ordinal is specified, the configuration order is used.

applies to

  • data item point with a point value type
  • data item Sequence_rel with as values unit the domain unit of the resulting arcs/polygons.
  • data item ordinal with uint32 value type

conditions

The domain units of all arguments must match.

Since GeoDMS 20.22.0 an ordinal that occurs twice within one sequence is an error, orderNr ... occurs more than once in sequence .... Before, it left another point of that sequence uninitialised, without a warning.

Since GeoDMS 20.22.0 the points are also placed in the right sequence when the values unit of Sequence_rel does not start at 0, such as range(uint32, 1, 11). Before, the points of sequence v were written to sequence v+1, so the result held uninitialised points, or the operator failed with the misleading error unexpected orderNr.

since version

5.15; variants available since 7.033

points2arc and points2multi_point (and their _p / _ps / _po / _pso variants) are available since 20.2.0.

performance

O(n log n) if ordinal sorting is needed, otherwise O(n) where n = number of points. Groups points by Sequence_rel and orders within groups.

example

attribute<fpoint> geometry (road, arc) := points2sequence(point, Sequence_rel, ordinal);

The same point table can be turned into a polygon or multipoint result by choosing the matching function and composition type:

attribute<fpoint> area_geometry  (road, polygon)    := points2polygon(point, Sequence_rel, ordinal);
attribute<fpoint> point_geometry (road, multipoint) := points2multi_point(point, Sequence_rel, ordinal);
point Sequence_rel Ordinal
xy(112631; 399246) 0 0
xy(111866; 398599) 0 1
xy(111866; 398599) 1 0
xy(111924; 399495) 1 1
xy(111524; 401801) 1 2
xy(114921; 401529) 2 0
xy(114823; 398584) 2 1

domain RoadPointSet, nr of rows = 7

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

see also

Clone this wiki locally