Tile Module¶
vcube.tile
¶
TileProcessor
¶
Processor for generating and caching tiles from satellite images.
Source code in src/vcube/tile.py
26 27 28 29 30 31 32 33 34 35 36 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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|
cache_time = cache_time
instance-attribute
¶
__init__(cache_time=60)
¶
apply_colormap(result, colormap_str)
staticmethod
¶
Apply a colormap to the result.
Parameters: result (numpy.ndarray): Array of results to apply the colormap to. colormap_str (str): Name of the colormap to apply.
Returns: PIL.Image.Image: Image with the applied colormap.
Source code in src/vcube/tile.py
fetch_tile(url, x, y, z)
async
staticmethod
¶
Fetch a tile from the given URL.
Parameters: url (str): URL of the tile. x (int): X coordinate of the tile. y (int): Y coordinate of the tile. z (int): Zoom level of the tile.
Returns: numpy.ndarray: Array of the tile data.
Source code in src/vcube/tile.py
cached_generate_tile(x: int, y: int, z: int, start_date: str, end_date: str, cloud_cover: int, band1: str, band2: str, formula: str, colormap_str: str = 'RdYlGn', latest: bool = True, operation: str = 'median') -> bytes
async
¶
Generate and cache a tile.
Parameters: x (int): X coordinate of the tile. y (int): Y coordinate of the tile. z (int): Zoom level of the tile. start_date (str): Start date for the data extraction (YYYY-MM-DD). end_date (str): End date for the data extraction (YYYY-MM-DD). cloud_cover (int): Maximum allowed cloud cover percentage. band1 (str): First band for the formula. band2 (str): Second band for the formula. formula (str): Formula to apply to the bands. colormap_str (str): Name of the colormap to apply. latest (bool): Whether to use the latest image. operation (str): Operation to apply to the time series.
Returns: bytes: Image bytes of the generated tile.
Source code in src/vcube/tile.py
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 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
|