dataset#

aiearth.predict.dataset.read_raster_dataset(raster_dataset: RasterDataset, image_size, bound, block_size=1, block_memory_buffer=100, aoi_vector_dataset: VectorDataset | None = None, read_block_image_column='image', read_block_box_column='box', read_block_pad_bounds_column='pad_bounds', size_bytes_growth_factor=1.25, ray_remote_args: Dict[str, Any] | None = None, **read_args)[源代码]#

datasource#

class aiearth.predict.dataset.datasource.RasterDatasetReader(raster_dataset: RasterDataset, image_size, bound, block_size, block_memory_buffer, aoi_vector_dataset: VectorDataset, read_block_image_column, read_block_box_column, read_block_pad_bounds_column, size_bytes_growth_factor)[源代码]#

基类:Reader

estimate_inmemory_data_size() int | None[源代码]#

Return an estimate of the in-memory data size, or None if unknown.

Note that the in-memory data size may be larger than the on-disk data size.

get_read_tasks(parallelism: int) List[ReadTask][源代码]#

Execute the read and return read tasks.

参数:
  • parallelism – The requested read parallelism. The number of read tasks should equal to this value if possible.

  • read_args – Additional kwargs to pass to the datasource impl.

返回:

A list of read tasks that can be executed to read blocks from the datasource in parallel.

class aiearth.predict.dataset.datasource.RasterDatasource[源代码]#

基类:Datasource

create_reader(raster_dataset, image_size, bound, block_size, block_memory_buffer, aoi_vector_dataset, read_block_image_column, read_block_box_column, read_block_pad_bounds_column, size_bytes_growth_factor, **read_args) Reader[T][源代码]#

Return a Reader for the given read arguments.

The reader object will be responsible for querying the read metadata, and generating the actual read tasks to retrieve the data blocks upon request.

参数:

read_args – Additional kwargs to pass to the datasource impl.

raster#

class aiearth.predict.dataset.raster.AIEGeoserverRasterDataset(uri, extent: Box | None = None, open_args={}, read_args={})[源代码]#

基类:RasterioDataset

open(uri: str, data_format: str = 'image/jpeg', tile_size: int = 256, max_level: int = 18, up_sample_level_limit: int = 16)[源代码]#
read_chip_data(dataset, window, **read_args)[源代码]#
set_chip_data_info()[源代码]#
class aiearth.predict.dataset.raster.RasterDataset[源代码]#

基类:object

class aiearth.predict.dataset.raster.RasterioDataset(uri, extent: Box | None = None, open_args={}, read_args={})[源代码]#

基类:RasterDataset

calc_window_bounds(w: Window)[源代码]#
calc_window_box_bounds(box: Box)[源代码]#
get_chip_dtype()[源代码]#
get_chip_item_byte_size()[源代码]#
get_chip_num_channels()[源代码]#
get_crs()[源代码]#
get_data_by_bounding_box(boxes: Box | List[Box])[源代码]#
get_data_by_window_box(boxes: Box | List[Box])[源代码]#
get_extent()[源代码]#
get_extent_height()[源代码]#
get_extent_transform()[源代码]#
get_extent_width()[源代码]#
open(uri, **kwargs)[源代码]#
read_chip_data(dataset: DatasetReader, window: Window, **read_args)[源代码]#
round_extent(extent: Box)[源代码]#
set_chip_data_info()[源代码]#
set_extent(extent: Box | shapely.geometry.polygon.Polygon)[源代码]#
set_extent_from_box(box: Box)[源代码]#
set_extent_from_polygon(polygon: shapely.geometry.polygon.Polygon, transform=None)[源代码]#
set_extent_height(height)[源代码]#
set_extent_width(width)[源代码]#
set_read_band_order(order: List[int])[源代码]#
class aiearth.predict.dataset.raster.TiffFileRasterDataset(uri, extent: Box | None = None, open_args={}, read_args={'boundless': True, 'fill_value': 0})[源代码]#

基类:RasterioDataset

open(uri: str)[源代码]#
read_chip_data(dataset: DatasetReader, window: Window, **read_args)[源代码]#
set_chip_data_info()[源代码]#

vector#

class aiearth.predict.dataset.vector.ShapeFileVectorDataset(path)[源代码]#

基类:VectorDataset

get_features()[源代码]#
get_geoms()[源代码]#
is_intersects_with_box(box: Box, need_index=True)[源代码]#
load_features()[源代码]#
class aiearth.predict.dataset.vector.VectorDataset[源代码]#

基类:object