Skip to content

Releases: NOAA-ORR-ERD/cell_tree2d

Mixed Polygon Support

28 Jul 22:46
Compare
Choose a tag to compare

cell_tree2d now supports being built over mixed polygons.

Vertices are still defined by a Nx2 numpy array. Faces can now be a NxM array of integer indices into the vertices array, or a length K array of indices accompanied by a separate array of N polygon lengths.

(In the following 'vXY' is the index of the vertex Y of the polygon X)
faces = [v00, v01, v02, v03, v04,      v10, v11, v12]
len_arr = [5, 3]

If the Faces array is NxM, it is assumed that there is 1 polygon per row with max number of sides M. 'Masked' indices are indicated with a value of -1. This indicates the polygon has fewer sides than the max. For example, in this 2x5 faces array:

faces = [[v00,v01,v02,v03,v04] (polygon with 5 sides)
         [v10,v11,v12, -1, -1]] (polygon with 3 sides)
len_arr = OPTIONAL

If no polygons contain a -1, then all the polygons have the same number of sides.

In the C:

  • Construction has been split into a more modular system. It now consists of three distinct functions (add_vertices(), add_polys(), and finalize()) that are used in the Cython to set the cell tree up.
  • Field types have been refactored to be more appropriate for their role

v0.2.0

19 Jul 20:46
Compare
Choose a tag to compare
added contiguous array check

v0.1.3

27 Jun 20:58
Compare
Choose a tag to compare
updated version in __init__

0.1.2

25 May 20:14
Compare
Choose a tag to compare

Data type more strictly enforced.
CellTree now holds python refs to verts/faces to avoid python dropping them.

multipoint

12 Dec 00:45
Compare
Choose a tag to compare
multipoint Pre-release
Pre-release

this version includes multipoint

Initial Release

10 Dec 00:19
Compare
Choose a tag to compare
Initial Release Pre-release
Pre-release
v0.1.0

Added locate function for a whole array of points