S2PolylineLayer

A layer type that assembles edges (directed or undirected) into an S2Polyline. Returns an error if the edges cannot be assembled into a single unbroken polyline.

Duplicate edges are handled correctly (e.g., if a polyline backtracks on itself, or loops around and retraces some of its previous edges.) The implementation attempts to preserve the order of directed input edges whenever possible, so that if the input is a polyline and it is not modified by S2Builder, then the output will be the same polyline (even if the polyline backtracks on itself or forms a loop). With undirected edges, there are no such guarantees; for example, even if the input consists of a single undirected edge, then either directed edge may be returned.

S2PolylineLayer does not support options such as discarding sibling pairs or merging duplicate edges because these options can split the polyline into several pieces. Use S2PolylineVectorLayer if you need these features.

Constructors

this
this(S2Polyline polyline, Options options)

Specifies that a polyline should be constructed using the given options.

this
this(S2Polyline polyline, LabelSetIds* label_set_ids, IdSetLexicon* label_set_lexicon, Options options)

Specifies that a polyline should be constructed using the given options, and that any labels attached to the input edges should be returned in "label_set_ids" and "label_set_lexicion".

Members

Aliases

LabelSetIds
alias LabelSetIds = LabelSetId[]
Undocumented in source.

Functions

build
void build(Graph g, S2Error error)
Undocumented in source. Be warned that the author may not have intended to support it.
graphOptions
GraphOptions graphOptions()

Layer interface:

Structs

Options
struct Options
Undocumented in source.

Inherited Members

From Layer

EdgeType
alias EdgeType = S2Builder.EdgeType
Undocumented in source.
GraphOptions
alias GraphOptions = .GraphOptions
Undocumented in source.
Graph
alias Graph = .Graph
Undocumented in source.
Label
alias Label = S2Builder.Label
Undocumented in source.
LabelSetId
alias LabelSetId = S2Builder.LabelSetId
Undocumented in source.
graphOptions
GraphOptions graphOptions()

Defines options for building the edge graph that is passed to Build().

build
void build(Graph g, S2Error error)

Assembles a graph of snapped edges into the geometry type implemented by this layer. If an error is encountered, sets "error" appropriately.

Meta