# xarray.indexes.TreeAdapter

### *class* xarray.indexes.TreeAdapter(points, , options)[[source]](https://github.com/pydata/xarray/blob/main/xarray/indexes/nd_point_index.py#L22-L69)

Lightweight adapter abstract class for plugging in 3rd-party structures
like [`scipy.spatial.KDTree`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.KDTree.html#scipy.spatial.KDTree) or `sklearn.neighbors.KDTree`
into [`NDPointIndex`](xarray.indexes.NDPointIndex.html.md#xarray.indexes.NDPointIndex).

#### *abstractmethod* \_\_init_\_(points, , options)[[source]](https://github.com/pydata/xarray/blob/main/xarray/indexes/nd_point_index.py#L29-L38)

* **Parameters:**
  **points** ([`ndarray`](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) of `shape (n_points`, `n_coordinates)`) – Two-dimensional array of points/samples (rows) and their
  corresponding coordinate labels (columns) to index.

### Methods

| [`__init__`](#xarray.indexes.TreeAdapter.__init__)(points, \*, options)   |                                                           |
|----------------------------------------------------------------------------------|-----------------------------------------------------------|
| `equals`(other)                                                                  | Check equality with another TreeAdapter of the same kind. |
| `query`(points)                                                                  | Query points.                                             |
