Source: https://gometry.monicz.dev/api/constructive/

# Constructive & validation

Split, snap, polygonize, and validate geometry.

**Related:** [Validation & repair](https://gometry.monicz.dev/guide/validation/)

## polygonize\_all

Accepted call forms

```python
polygonize_all(
    values: Geometry
    | GeometryArray[Geometry | None]
    | Iterable[
        Geometry | Buffer | Mapping[str, Any] | SupportsGeoInterface | None
    ],
    *,
    diagnostics: Literal[False] = False,
) -> GeometryArray[Polygon]
```

```python
polygonize_all(
    values: Geometry
    | GeometryArray[Geometry]
    | Iterable[Geometry | Buffer | Mapping[str, Any] | SupportsGeoInterface],
    *,
    diagnostics: Literal[True],
) -> PolygonizeResult[Never]
```

```python
polygonize_all(
    values: Geometry
    | GeometryArray[Geometry | None]
    | Iterable[
        Geometry | Buffer | Mapping[str, Any] | SupportsGeoInterface | None
    ],
    *,
    diagnostics: Literal[True],
) -> PolygonizeResult[None]
```

```python
polygonize_all(
    values: Geometry
    | GeometryArray[Geometry]
    | Iterable[Geometry | Buffer | Mapping[str, Any] | SupportsGeoInterface],
    *,
    diagnostics: bool,
) -> GeometryArray[Polygon] | PolygonizeResult[Never]
```

```python
polygonize_all(
    values: Geometry
    | GeometryArray[Geometry | None]
    | Iterable[
        Geometry | Buffer | Mapping[str, Any] | SupportsGeoInterface | None
    ],
    *,
    diagnostics: bool,
) -> GeometryArray[Polygon] | PolygonizeResult[None]
```

Build polygons from pooled linework, optionally returning full diagnostics.

All input geometries' edges are pooled into one linework graph, so a ring can
close across inputs. `diagnostics=False` returns the enclosed polygons;
`diagnostics=True` returns those same polygons together with cut edges,
dangles, and invalid rings grouped by source row. Missing source rows are
`None` groups; present rows with no diagnostic linework are empty groups.

For geographic input, polygon faces and diagnostic lines use the same
classification, so an edge of a returned face is not also reported as an
invalid ring.

`GeometryArray.polygonize()` instead preserves one result group per input
row, so use this function when different rows' edges should close together.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `values` | `Geometry, GeometryArray, or iterable of Geometry-like values` | One geometry or linework values to node and polygonize together. Array and iterable inputs may contain `None` rows; they are omitted from the pooled linework. | *required* |
| `diagnostics` | `bool` | Return a `PolygonizeResult` containing the pooled polygons and source-row `ListArray` for cut edges, dangles, and invalid rings. | *required* |

Returns:

| Type | Description |
| --- | --- |
| `GeometryArray or PolygonizeResult` | With the default `False`, the polygons enclosed by the pooled linework. With `True`, the same polygons plus the leftover-linework diagnostics. |

See Also

[Geometry.polygonize](https://gometry.monicz.dev/api/geometry/#gometry.Geometry.polygonize "polygonize") : Polygonize one geometry's own linework.
[GeometryArray.polygonize](https://gometry.monicz.dev/api/geometry-array/#gometry.GeometryArray.polygonize "polygonize") : Polygonize each array row independently.
[union\_all](https://gometry.monicz.dev/api/overlay/#gometry.union_all "union_all") : Union of many geometries into one.
[intersection\_all](https://gometry.monicz.dev/api/overlay/#gometry.intersection_all "intersection_all") : Common region shared by many geometries.

Examples:

```pycon
>>> import gometry as gm
>>> edges = [
...     gm.LineString([(0, 0), (1, 0)]),
...     gm.LineString([(1, 0), (1, 1)]),
...     gm.LineString([(1, 1), (0, 0)]),
... ]
>>> gm.polygonize_all(edges).to_wkt()
['POLYGON ((0 0, 1 0, 1 1, 0 0))']
>>> result = gm.polygonize_all(edges, diagnostics=True)
>>> result.polygons.to_wkt()
['POLYGON ((0 0, 1 0, 1 1, 0 0))']
```

## require

Accepted call forms

```python
require(
    value: GeometryT,
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> GeometryT
```

```python
require(
    value: GeometryArray[GeometryRowT],
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> GeometryArray[GeometryRowT]
```

```python
require(
    value: ListArray[GeometryArray[GeometryRowT]],
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> GeometryArray[GeometryRowT]
```

```python
require(
    value: ListArray[GeometryArray[GeometryRowT] | None],
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> GeometryArray[GeometryRowT]
```

```python
require(
    value: str | Buffer | Mapping[str, Any] | SupportsGeoInterface,
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> Geometry
```

```python
require(
    value: Iterable[GeometryRowT],
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> GeometryArray[GeometryRowT]
```

```python
require(
    value: Iterable[
        Geometry
        | str
        | Buffer
        | Mapping[str, Any]
        | SupportsGeoInterface
        | None
    ],
    *,
    space: Space | None = None,
    crs: CrsInput | None = None,
    model: Literal['planar', 'chart', 'spherical'] | None = None,
    epoch: SupportsFloat
    | SupportsIndex
    | FloatScalar
    | ScalarFloatArray
    | None = None,
    axes: Literal['XY', 'XYZ', 'XYM', 'XYZM'] | None = None,
) -> GeometryArray[Geometry | None]
```

Parse and require a geometry contract at an input boundary.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `value` | `geometry-like or iterable of geometry-like` | One geometry, a `GeometryArray`, a geometry-valued `ListArray`, or an iterable. Foreign scalar inputs may be WKT, WKB, GeoJSON mappings/text, or `__geo_interface__` objects. Geometry-valued groups are flattened in group order and return a `GeometryArray`. | *required* |
| `space` | `Space` | Require the complete interpretation, including frame, model and epoch. Cannot be combined with `crs`, `model` or `epoch`. | `None` |
| `crs` | `CrsInput` | Expected CRS for the result. Native values are checked without changing their labels or interpretation; compatible CRS spellings are accepted. Raw formats can use the expected CRS to supply absent source metadata before validation. A conflicting CRS raises `CRSMismatchError`. When omitted or `None`, no target is required and an existing CRS is preserved. Accepted forms include authority/WKT/PROJ strings, non-boolean integer-like EPSG codes, `(authority, code)` pairs, PROJJSON/CF mappings, objects exposing `to_authority()`, `to_epsg()`, `to_wkt()`, or `to_json()`, and objects whose `crs` or `srs` property contains another accepted form. Native epochs and models are preserved. | `None` |
| `model` | `('planar', 'chart', 'spherical')` | Require the declared interpretation, including for point-only values. | `'planar'` |
| `epoch` | `numeric scalar` | Require the coordinate epoch in decimal years. | `None` |
| `axes` | `('XY', 'XYZ', 'XYM', 'XYZM')` | If given, require the geometry's coordinate axes to match exactly, otherwise raise. | `'XY'` |

Returns:

| Type | Description |
| --- | --- |
| `Geometry or GeometryArray` | The validated input. Iterables return a `GeometryArray`. |

Raises:

| Type | Description |
| --- | --- |
| `CRSError` | If `crs` is not a recognized CRS. |
| `ParseError` | If foreign GeoJSON is malformed, or its legacy `crs` member is unsupported or conflicts with `crs` (`format` is `"geojson"`). |
| `CRSMismatchError` | If an already-decoded / native / non-GeoJSON geometry's CRS conflicts with `crs` or its epoch conflicts with the requirement. EWKT/EWKB embedded SRID conflicts use this error too. |
| `GeometryError` | If the geometry model conflicts with the requested interpretation. |
| `TypeError` | If `space` is combined with `crs`, `model` or `epoch`. |
| `InvalidGeometryError` | If the geometry is invalid, or its axes differ from `axes`. Geographic validity uses exact quotient topology, so longitude aliases and seam cuts do not depend on stored spelling. Out-of-domain latitude is invalid. For quotient-topology issues, the location is a canonical coordinate of the issue's contact set, chosen deterministically by minimum latitude then longitude. Projected and CRS-free geometry remains planar. |

See Also

[Geometry.validate](https://gometry.monicz.dev/api/geometry/#gometry.Geometry.validate "validate") : Structured validity report.
Geometry.repair : Fix the geometry.

Examples:

```pycon
>>> import gometry as gm
>>> gm.require(gm.Point(1, 2, space=gm.Space(crs=4326)), crs=4326).to_wkt()
'POINT (1 2)'
```

## shared\_paths

Accepted call forms

```python
shared_paths(left: Geometry, right: Geometry) -> GeometryCollection
```

```python
shared_paths(
    left: Geometry,
    right: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[GeometryT],
) -> GeometryArray[GeometryCollection]
```

```python
shared_paths(
    left: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[GeometryT],
    right: Geometry,
) -> GeometryArray[GeometryCollection]
```

```python
shared_paths(
    left: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[GeometryT],
    right: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT
    ],
) -> GeometryArray[GeometryCollection]
```

```python
shared_paths(
    left: Geometry,
    right: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryT | None
    ],
) -> GeometryArray[GeometryCollection | None]
```

```python
shared_paths(
    left: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryT | None
    ],
    right: Geometry,
) -> GeometryArray[GeometryCollection | None]
```

```python
shared_paths(
    left: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryT | None
    ],
    right: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT | None
    ],
) -> GeometryArray[GeometryCollection | None]
```

```python
shared_paths(
    left: Geometry
    | (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[Geometry | None],
    right: Geometry
    | (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[Geometry | None],
) -> GeometryCollection | GeometryArray[GeometryCollection | None]
```

Shared paths between two lineal geometries.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `left` | `Geometry, GeometryArray, or iterable of Geometry or None` | Two lineal operands. Scalar and sequence inputs broadcast pairwise; sequences must have equal length and compatible CRS/epoch frames. | *required* |
| `right` | `Geometry, GeometryArray, or iterable of Geometry or None` | Two lineal operands. Scalar and sequence inputs broadcast pairwise; sequences must have equal length and compatible CRS/epoch frames. | *required* |

Returns:

| Type | Description |
| --- | --- |
| `Geometry or GeometryArray` | The shared linework. |

Raises:

| Type | Description |
| --- | --- |
| `CRSMismatchError` | If operands' CRS or coordinate-epoch metadata differ. |
| `GeometryTypeError` | If either operand is not lineal. |

Examples:

```pycon
>>> import gometry as gm
>>> gm.shared_paths(gm.LineString([(0, 0), (2, 0)]), gm.LineString([(1, 0), (3, 0)])).to_wkt()
'GEOMETRYCOLLECTION (MULTILINESTRING ((1 0, 2 0)), MULTILINESTRING EMPTY)'
```

## snap

Accepted call forms

```python
snap(
    geom: GeometryT,
    reference: Geometry,
    tolerance: float,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryT
```

```python
snap(
    geom: MultiPoint,
    reference: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT
    ],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[MultiPoint]
```

```python
snap(
    geom: MultiPoint,
    reference: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT | None
    ],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[MultiPoint | None]
```

```python
snap(
    geom: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[GeometryT],
    reference: Geometry
    | (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[GeometryOtherT],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[GeometryT]
```

```python
snap(
    geom: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryT | None
    ],
    reference: Geometry
    | (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT | None
    ],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[GeometryT | None]
```

```python
snap(
    geom: GeometryT,
    reference: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT
    ],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[GeometryT]
```

```python
snap(
    geom: GeometryT,
    reference: (GeometryArray[GeometryRowT] | Iterable[GeometryRowT])[
        GeometryOtherT | None
    ],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[GeometryT | None]
```

```python
snap(
    geom: Geometry | GeometryArray[Geometry | None],
    reference: Geometry | GeometryArray[Geometry | None],
    tolerance: FloatInput,
    *,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> Geometry | GeometryArray[Geometry | None]
```

Snap vertices of `geom` onto `reference` within `tolerance`.

Each source vertex snaps independently to its nearest reference vertex at
or below `tolerance`; if none is in range, it stays unchanged. An exact
model-position match takes precedence over physically coincident aliases.
Otherwise a computed-distance tie goes to the reference vertex with the smaller X,
then Y, using IEEE total order. Multiple source vertices may snap to the
same reference vertex.

On each line segment, every reference vertex whose projection lies in the
open segment, whose segment distance is at or below `tolerance`, and
whose distance from both endpoints is greater than `tolerance` is
inserted at its reference X/Y. Insertions follow segment order; equal
projections are ordered by reference X/Y.

Snapped source vertices retain their own Z/M. Insertions interpolate fields
at the original source parameter: affine fields on Planar edges and
source-ellipsoid arclength fields on Chart and Spherical edges. Selecting a
measuring sphere does not change that source-field ellipsoid. Reference Z/M
never contributes. Geographic aliases retain the source-side longitude or
pole spelling needed for their incident branches.

Consecutive line
redundant source positions are emitted once, keeping the first. Necessary
Chart half-turn and pole-departure records survive. If only one coordinate
remains, the snapped start
and end are retained as two endpoints, which may share X/Y. Closed rings
are reclosed.

Snapping may collapse polygon rings: collapsed holes are dropped and a
collapsed shell produces an empty polygon. Snapping does not validate or
repair topology, so a snapped polygon may be invalid.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `geom` | `Geometry, GeometryArray, or iterable of Geometry or None` | Geometry whose vertices are moved. Missing rows remain missing. | *required* |
| `reference` | `Geometry, GeometryArray, or iterable of Geometry or None` | Target geometry to snap onto. | *required* |
| `tolerance` | `float or sequence of float` | Maximum finite non-negative proximity in the selected metric's units. Geographic CRSs default to metres, including Planar values; projected CRSs use native linear units and CRS-free values use coordinate units. Zero uses exact model identity and incidence. Positive physical snapping can copy another longitude sheet into a Planar value; its edges remain literal Planar edges. This bounds vertex/projection proximity, not the deviation of the resulting curves. | *required* |
| `metric` | `None, "cartesian", or Sphere` | Measuring surface, independently of the input curve model. Cartesian distance is available only for Planar values. | `None` |
| `unit` | `None or 'meters'` | Override the tolerance's distance units. | `None` |

Returns:

| Type | Description |
| --- | --- |
| `Geometry or GeometryArray` | Snapped result(s), with missing rows preserved. |

Raises:

| Type | Description |
| --- | --- |
| `CRSMismatchError` | If operands' CRS or coordinate-epoch metadata differ. |
| `GeometryError` | If `tolerance` is invalid. |

Examples:

```pycon
>>> import gometry as gm
>>> gm.snap(gm.Point(0.01, 0), gm.Point(0, 0), 0.1).to_wkt()
'POINT (0 0)'
```

## split

Accepted call forms

```python
split(
    geom: LineString | MultiLineString,
    splitter: Point | MultiPoint | GeometryArray[Point | MultiPoint | None],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[LineString]
```

```python
split(
    geom: GeometryArray[LineString | MultiLineString],
    splitter: Point | MultiPoint | GeometryArray[Point | MultiPoint],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> ListArray[GeometryArray[LineString]]
```

```python
split(
    geom: GeometryArray[LineString | MultiLineString | None],
    splitter: Point | MultiPoint | GeometryArray[Point | MultiPoint],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> ListArray[GeometryArray[LineString] | None]
```

```python
split(
    geom: GeometryArray[LineString | MultiLineString],
    splitter: GeometryArray[Point | MultiPoint | None],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> ListArray[GeometryArray[LineString] | None]
```

```python
split(
    geom: GeometryArray[LineString | MultiLineString | None],
    splitter: GeometryArray[Point | MultiPoint | None],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> ListArray[GeometryArray[LineString] | None]
```

```python
split(
    geom: Geometry,
    splitter: Geometry | GeometryArray[Geometry | None],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> GeometryArray[LineString]
```

```python
split(
    geom: GeometryArray[Geometry],
    splitter: Geometry | GeometryArray[Geometry],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> ListArray[GeometryArray[LineString]]
```

```python
split(
    geom: GeometryArray[Geometry | None],
    splitter: Geometry | GeometryArray[Geometry | None],
    *,
    tolerance: float = 0.0,
    metric: Literal['cartesian'] | Sphere | None = None,
    unit: Literal['meters'] | None = None,
) -> ListArray[GeometryArray[LineString] | None]
```

Split lineal geometry by point splitter(s).

Each piece retains source vertices, including consecutive equal-X/Y
vertices whose active Z/M ordinates differ and necessary pole-departure
records. Inserted fields use the original source parameter: affine fields
for Planar edges and original-ellipsoid arclength for Chart/Spherical edges.

Positive tolerance positions each cutter at one nearest location across
the source's complete linework, choosing the earliest source part and
parameter in a tie. Every interior visit to that model position is cut.
Distinct cut parameters remain distinct even when closer than the tolerance.
Stationary runs retain their records in the following piece; endpoint runs
do not create extra fragments. No source vertex moves to an off-line cutter.

Parameters:

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `geom` | `Geometry or GeometryArray` | Lineal geometry to split. | *required* |
| `splitter` | `Geometry or GeometryArray` | Point or multipoint cutter. | *required* |
| `tolerance` | `(float, keyword - only)` | Finite non-negative positioning allowance. Geographic CRSs default to metres, including Planar values; projected CRSs use native linear units and CRS-free values use raw coordinate units. The default `0.0` uses exact model incidence. A positive physical allowance can locate a cutter on another longitude sheet without identifying distinct Planar positions. | `0.0` |
| `metric` | `None, "cartesian", or Sphere` | Measuring surface, independently of the source curve model. Cartesian distance is available only for Planar values. | `None` |
| `unit` | `None or 'meters'` | Override the positioning allowance's distance units. | `None` |

Returns:

| Type | Description |
| --- | --- |
| `GeometryArray or ListArray[GeometryArray]` | A scalar line returns all split parts in one `GeometryArray`, even when its cutter is an array of points. A line array returns one `ListArray` row per source line; an array cutter is paired row by row. Missing line or cutter rows produce `None` rows; present rows with no split parts produce empty rows. |

Raises:

| Type | Description |
| --- | --- |
| `GeometryError` | If `tolerance` is negative or non-finite. |
| `CRSMismatchError` | If operands' CRS or coordinate-epoch metadata differ. |
| `GeometryTypeError` | If `geom` is not lineal. |

Examples:

```pycon
>>> import gometry as gm
>>> gm.split(gm.LineString([(0, 0), (2, 0)]), gm.Point(1, 0)).to_wkt()
['LINESTRING (0 0, 1 0)', 'LINESTRING (1 0, 2 0)']
>>> pieces = gm.split(gm.GeometryArray([gm.LineString([(0, 0), (2, 0)])]), gm.Point(1, 0))
>>> pieces.offsets.tolist()
[0, 2]
```
