If specified, then each output edge will be labelled with one or more
SourceIds indicating which input edge(s) it corresponds to. This
can be useful if your input geometry has additional data that needs to
be propagated from the input to the output (e.g., elevations).
You can access the labels by using an S2Builder::Layer type that
supports labels, such as S2PolygonLayer. The layer outputs a
"label_set_lexicon" and an "label_set_id" for each edge. You can then
look up the source information for each edge like this:
for (int32 label : label_set_lexicon.id_set(label_set_id)) {
const SourceId& src = source_id_lexicon.value(label);
// region_id() specifies which S2ShapeIndex the edge is from (0 or 1).
DoSomething(src.region_id(), src.shape_id(), src.edge_id());
}
If specified, then each output edge will be labelled with one or more SourceIds indicating which input edge(s) it corresponds to. This can be useful if your input geometry has additional data that needs to be propagated from the input to the output (e.g., elevations).
You can access the labels by using an S2Builder::Layer type that supports labels, such as S2PolygonLayer. The layer outputs a "label_set_lexicon" and an "label_set_id" for each edge. You can then look up the source information for each edge like this:
for (int32 label : label_set_lexicon.id_set(label_set_id)) { const SourceId& src = source_id_lexicon.value(label); // region_id() specifies which S2ShapeIndex the edge is from (0 or 1). DoSomething(src.region_id(), src.shape_id(), src.edge_id()); }
DEFAULT: nullptr