TriSearch

The TriSearch class is used to create a spatial index for searching triangles.

class xms.grid.geometry.TriSearch(points=None, triangles=None, **kwargs)
__init__(points=None, triangles=None, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

interp_weights(point)

Use the stored triangles to get interpolation weights for a point.

Parameters

point (iterable) – location that is interpolated to.

Returns

A tuple of a flag if it was successful, triangle point indices and triangle point weights.

interp_weights_triangle_index(point)
Parameters

point (iterable) – location that is interpolated to.

Returns

A tuple of a flag if it was successful, triangle containing the point, triangle point indices and triangle point weights or None if the point is not any triangle

property point_activity

Activity of the points

property points

Points in the search

property triangle_activity

Activity of the triangles

triangle_containing_point(point)

Find the triangle containing the point

Parameters

point (iterable) – The location used to find the triangle

Returns

The index of the triangle containing point

triangle_envelopes_overlap(min_point, max_point)

Find all triangles whose envelope overlaps the envelope defined by min and max.

Parameters
  • min_point – min x,y location of the box

  • max_point – max x,y location of the box

Returns

The indices to triangles whose envelope intersects with the input envelope.

triangle_envelops_containing_point(point)

Find all triangles whose envelope contains the point.

Parameters

point (iterable) – The point to search for

Returns

The indices to triangles whose envelope contains the point

property triangles

Triangles in the search