Skip to content

Points2sequence

MaartenHilferink edited this page Jun 14, 2026 · 13 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 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
{399246, 112631} 0 0
{398599, 111866} 0 1
{398599, 111866} 1 0
{399495, 111924} 1 1
{401801, 111524} 1 2
{401529, 114921} 2 0
{398584, 114823} 2 1

domain RoadPointSet, nr of rows = 7

geometry
{2 {399246, 112631}{398599, 111866}}
{3 {398599, 111866}{399495, 111924} {401801,111524}}
{2 {401529, 114921}{398584, 114823}}

domain Road, nr of rows = 3

see also

Clone this wiki locally