Extents#

class silvimetric.resources.extents.Extents(bounds: Bounds, resolution: float, root: Bounds)#

Handles bounds operations for point cloud data.

bounds#

Bounding box of this section of data.

cell_count#

Number of cells in this Extents

chunk(data: Data, res_threshold=100, pc_threshold=600000, depth_threshold=6)#

Split up a dataset into tiles based on the given thresholds. Unlike Scan this will filter out any tiles that contain no points.

Parameters:
  • data – Incoming Data object to oeprate on.

  • res_threshold – Resolution threshold., defaults to 100

  • pc_threshold – Point count threshold., defaults to 600000

  • depth_threshold – Tree depth threshold., defaults to 6

Returns:

Return list of Extents that fit the criteria

disjoint(other)#

Determined if this Extents shares any points with another Extents object.

Parameters:

other – Extents object to compare against.

Returns:

True if no shared points, false otherwise.

disjoint_by_mbr(mbr)#

Determine if this Extents shares any points with a minimum bounding rectangle.

Parameters:

mbr – Minimum bounding rectangle as defined by TileDB.

Returns:

True if no shared points, false otherwise.

domain: tuple[tuple[float, float], tuple[float, float]]#

Minimum bounding rectangle of this Extents

filter(data: Data, res_threshold=100, pc_threshold=600000, depth_threshold=6, depth=0)#

Creates quad tree of chunks for this bounds, runs pdal quickinfo over this to determine if there are any points available. Uses a bottom resolution of 1km.

Parameters:
  • data – Data object containing point cloud details.

  • res_threshold – Resolution threshold., defaults to 100

  • pc_threshold – Point count threshold., defaults to 600000

  • depth_threshold – Tree depth threshold., defaults to 6

  • depth – Current tree depth., defaults to 0

Returns:

Returns a list of Extents.

static from_storage(tdb_dir: str)#

Create Extents from information stored in database.

Parameters:

tdb_dir – TileDB database directory.

Returns:

Returns resulting Extents.

static from_sub(tdb_dir: str, sub: Bounds)#

Create an Extents that is less than the overall extents of the database.

Parameters:
  • tdb_dir – TileDB database directory.

  • sub – Desired bounding box.

Returns:

Returns resulting Extents.

get_indices()#

Create indices for this section of the database relative to the root bounds.

Returns:

Indices of this bounding box

get_leaf_children(tile_size)#

Get children Extents with given number of cells per tile.

Parameters:

tile_size – Cells per tile.

Yield:

Yield from list of child extents.

rangex#

Range of X Indices

rangey#

Range of Y indices

resolution#

Resolution of database.

root#

Root bounding box of the database.

split()#

Split this extent into 4 children along the cell lines

Returns:

Returns 4 child extents

x1#

Minimum X index

x2#

Maximum X index

y1#

Minimum Y index, or maximum Y value in point cloud

y2#

Maximum Y index, or minimum Y value in point cloud