Tile
Source code in geocube/entities/tile.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
|
from_aoi(aoi, crs, resolution)
classmethod
Parameters:
Name | Type | Description | Default |
---|---|---|---|
aoi |
multipolygon in 4326 coordinates |
required | |
crs |
(Coordinate Reference System) of the tile |
required | |
resolution |
of the pixel in the CRS |
required |
Returns:
Type | Description |
---|---|
Tile
|
A new tile |
Source code in geocube/entities/tile.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
from_bbox(bbox, crs, resolution)
classmethod
Create a tile from a bbox, a crs and a resolution
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bbox |
(x1, y1, x2, y2) in crs coordinates |
required | |
crs |
(Coordinate Reference System) of the tile |
required | |
resolution |
of the pixel in the CRS |
required |
Returns:
Type | Description |
---|---|
Tile
|
A new tile |
Source code in geocube/entities/tile.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
from_geotransform(transform, crs, shape)
classmethod
Create a tile from a geotransform, a crs and a shape
Parameters:
Name | Type | Description | Default |
---|---|---|---|
transform |
Union[affine.Affine, Tuple[float, float, float, float, float, float]]
|
geotransform from pixel coordinates to CRS. |
required |
crs |
Union[str, int]
|
Coordinate Reference System of the tile |
required |
shape |
Tuple[int, int]
|
shape of the tile (in pixel) (@warning shape is the transpose of numpy shape) |
required |
Returns:
Type | Description |
---|---|
Tile
|
A new tile |
Source code in geocube/entities/tile.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
from_record(record, crs, resolution)
classmethod
Create a tile that cover the record in the crs at a given resolution
Warning: record.aoi must be loaded (with client.load_aoi())
Warning: Check the result.shape
as the size might be huge !
Warning: the aoi is converted to the crs, but it might be imprecise at the borders
Parameters:
Name | Type | Description | Default |
---|---|---|---|
record |
entities.Record
|
required | |
crs |
Union[str, int]
|
Coordinate Reference System of the tile |
required |
resolution |
float
|
resolution of the pixel in the CRS |
required |
Returns:
Type | Description |
---|---|
Tile
|
A new tile |
Source code in geocube/entities/tile.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
reshape(i1, j1, i2, j2)
Create a new Tile using the coordinate pixels @warning inverse of numpy coordinates
Source code in geocube/entities/tile.py
146 147 148 149 150 |
|