ee_image
export_image(image_or_asset_id, geometry, transform, crs, bands_gee, dtype_dst=None, pad_add=(0, 0), crs_polygon='EPSG:4326', resolution_dst=None)
¶
Exports an image from the GEE as a GeoTensor.
It uses the ee.data.getPixels
or ee.data.computePixels
method to export the image.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image_or_asset_id
|
Union[str, Image]
|
Name of the asset or ee.Image object. |
required |
geometry
|
Union[Polygon, MultiPolygon]
|
geometry to export |
required |
transform
|
Affine
|
transform of the geometry |
required |
crs
|
str
|
crs of the geometry |
required |
pad_add
|
Tuple[int, int]
|
pad in pixels to add to the resulting |
(0, 0)
|
bands_gee
|
List[str]
|
List of bands to export |
required |
crs_polygon
|
str
|
crs of the geometry. Defaults to "EPSG:4326". |
'EPSG:4326'
|
Returns:
Name | Type | Description |
---|---|---|
GeoTensor |
GeoTensor
|
GeoTensor object |
Source code in georeader/readers/ee_image.py
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 |
|
export_cube(query, geometry, transform=None, crs=None, dtype_dst=None, bands_gee=None, crs_polygon='EPSG:4326', display_progress=True)
¶
Download all images in the query that intersects the geometry.
Note: This function is intended for small areas. If the area is too big that there are several images per day that intesesects the geometry, it will not group the images by day.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query
|
GeoDataFrame
|
dataframe from |
required |
geometry
|
Union[Polygon, MultiPolygon]
|
geometry to export |
required |
transform
|
Optional[Affine]
|
transform of the geometry. If None it will use the transform of the first image translated to the geometry. Defaults to None. |
None
|
crs
|
Optional[str]
|
crs of the geometry. If None it will use the crs of the first image. Defaults to None. |
None
|
dtype_dst
|
Optional[str]
|
dtype of the output GeoTensor. Defaults to None. |
None
|
bands_gee
|
Optional[List[str]]
|
List of bands to export. If None it will use the bands_gee column in the query. Defaults to None. |
None
|
crs_polygon
|
_type_
|
crs of the geometry. Defaults to "EPSG:4326". |
'EPSG:4326'
|
display_progress
|
bool
|
Display progress bar. Defaults to False. |
True
|
Returns:
Name | Type | Description |
---|---|---|
GeoTensor |
Optional[GeoTensor]
|
GeoTensor object with 4 dimensions: (time, band, y, x) |
Source code in georeader/readers/ee_image.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
|
query(area, date_start, date_end, producttype='S2', filter_duplicates=True, return_collection=False, add_s2cloudless=False, extra_metadata_keys=None)
¶
Query Landsat and Sentinel-2 products from the Google Earth Engine.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
area
|
Union[MultiPolygon, Polygon]
|
area to query images in EPSG:4326 |
required |
date_start
|
datetime
|
datetime in a given timezone. If tz not provided UTC will be assumed. |
required |
date_end
|
datetime
|
datetime in UTC. If tz not provided UTC will be assumed. |
required |
producttype
|
str
|
'S2', "Landsat"-> {"L8", "L9"}, "both" -> {"S2", "L8", "L9"}, "S2_SR", "L8", "L9" |
'S2'
|
filter_duplicates
|
bool
|
Filter S2 images that are duplicated |
True
|
return_collection
|
bool
|
returns also the corresponding image collection |
False
|
add_s2cloudless
|
bool
|
Adds a column that indicates if the s2cloudless image is available (from collection COPERNICUS/S2_CLOUD_PROBABILITY collection) |
False
|
extra_metadata_keys
|
Optional[List[str]]
|
list of extra metadata keys to add to the geodataframe. |
None
|
Returns:
Type | Description |
---|---|
Union[GeoDataFrame, Tuple[GeoDataFrame, ImageCollection]]
|
geodataframe with available products in the given area and time range |
Union[GeoDataFrame, Tuple[GeoDataFrame, ImageCollection]]
|
if |
Source code in georeader/readers/ee_query.py
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 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
|
query_s1(area, date_start, date_end, filter_duplicates=True, return_collection=False)
¶
Query S1 products from the Google Earth Engine
Parameters:
Name | Type | Description | Default |
---|---|---|---|
area
|
Union[MultiPolygon, Polygon]
|
|
required |
date_start
|
datetime
|
|
required |
date_end
|
datetime
|
|
required |
filter_duplicates
|
bool
|
|
True
|
return_collection
|
bool
|
|
False
|
Returns:
Source code in georeader/readers/ee_query.py
20 21 22 23 24 25 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 |
|
query_landsat_457(area, date_start, date_end, producttype='all', filter_duplicates=True, return_collection=False, extra_metadata_keys=None)
¶
Query Landsat-7, Landsat-5 or Landsat-4 products from the Google Earth Engine.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
area
|
Union[MultiPolygon, Polygon]
|
area to query images in EPSG:4326 |
required |
date_start
|
datetime
|
datetime in a given timezone. If tz not provided UTC will be assumed. |
required |
date_end
|
datetime
|
datetime in UTC. If tz not provided UTC will be assumed. |
required |
producttype
|
str
|
'all' -> {"L4", "L5", "L7"}, "L4", "L5" or "L7". Defaults to "all". |
'all'
|
filter_duplicates
|
bool
|
filter duplicate images over the same area. Defaults to True. |
True
|
return_collection
|
bool
|
returns also the corresponding image collection. Defaults to False. |
False
|
extra_metadata_keys
|
Optional[List[str]]
|
extra metadata keys to add to the geodataframe. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
Union[GeoDataFrame, Tuple[GeoDataFrame, ImageCollection]]
|
Union[gpd.GeoDataFrame, Tuple[gpd.GeoDataFrame, ee.ImageCollection]]: geodataframe with available products in the given area and time range |
Source code in georeader/readers/ee_query.py
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 |
|