xoak.index.s2_adapters.S2PointIndexAdapter¶
- class xoak.index.s2_adapters.S2PointIndexAdapter(**kwargs)[source]¶
Xoak index adapter for
pys2index.S2PointIndex
.It can be used for efficient indexing of a set of latitude / longitude points.
When building the index, the coordinates must be given in the latitude, longitude order.
Latitude and longitude values must be in degrees for both index and query points.
See https://github.com/benbovy/pys2index.
This index adapter is registered in xoak under the name
s2point
. You can use it inxarray.Dataset.xoak.set_index()
by simply providing its name for theindex_type
argument. Alternatively, you can access it via the index registry, i.e.,>>> import xoak >>> ireg = xoak.IndexRegistry() >>> ireg.s2point
- __init__(**kwargs)¶
Methods
__init__
(**kwargs)build
(points)Build the index from a set of points/samples and their coordinate labels.
query
(s2index, points)Query points/samples,