Download Module¶
The geefetch.data.get module contains the primary functions for initiating and managing satellite data downloads from Google Earth Engine.
geefetch.data.get
¶
download_time_series(data_dir, bbox, satellite, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, satellite_get_kwargs=None, satellite_download_kwargs=None, check_clean=True, filter_polygon=None, **kwargs)
¶
Download time series of images from a specific satellite. Images are written in several .tif
chips grouped in subdirectories in dir. Each subdirectory contains the time series of images
of a single spatial tile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory or file name to write the downloaded files to. If a directory,
the default |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
satellite
|
SatelliteABC
|
The satellite which the images should originate from. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10 Mb. |
10
|
satellite_get_kwargs
|
dict[str, Any] | None
|
Satellite-dependent parameters for getting data. Defaults to None. |
None
|
satellite_download_kwargs
|
dict[str, Any] | None
|
Satellite-dependent parameters for downloading data. Defaults to None. |
None
|
check_clean
|
bool
|
Whether to check if the data is clean. Defaults to True. |
True
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
**kwargs
|
Any
|
Accepted but ignored additional arguments. |
{}
|
Source code in src/geefetch/data/get.py
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 | |
download(data_dir, bbox, satellite, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, satellite_get_kwargs=None, satellite_download_kwargs=None, check_clean=True, filter_polygon=None, in_parallel=False, max_workers=10)
¶
Download images from a specific satellite. Images are written in several .tif chips
to dir. Additionally, a file .vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory or file name to write the downloaded files to. If a directory,
the default |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
satellite
|
SatelliteABC
|
The satellite which the images should originate from. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. Defaults to None. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10 Mb. |
10
|
satellite_get_kwargs
|
dict[str, Any] | None
|
Satellite-dependent parameters for getting data. Defaults to None. |
None
|
satellite_download_kwargs
|
dict[str, Any] | None
|
Satellite-dependent parameters for downloading data. Defaults to None. |
None
|
check_clean
|
bool
|
Whether to check if the data is clean. Defaults to True. |
True
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
in_parallel
|
bool
|
Whether to send parallel download requests. Do not use if the download backend
is already threaded (e.g., :class: |
False
|
max_workers
|
int
|
How many parallel workers are used in case |
10
|
Source code in src/geefetch/data/get.py
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 296 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 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 | |
download_gedi(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None)
¶
Download GEDI images fused as rasters. Images are written in several .tif chips
to data_dir. Additionally, a file gedi.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
Source code in src/geefetch/data/get.py
download_gedi_vector(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, tile_shape=500, resolution=10, filter_polygon=None, format=Format.CSV)
¶
Download GEDI vector points. Points are written in several .geojson files
to data_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
format
|
Format
|
Format in which to save the vector points. Defaults to Format.CSV. |
CSV
|
Source code in src/geefetch/data/get.py
download_s1(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None, orbit=S1Orbit.ASCENDING)
¶
Download Sentinel-1 images. Images are written in several .tif chips
to data_dir. Additionally, a file s1.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
orbit
|
S1Orbit
|
The orbit used to filter Sentinel-1 images. Defaults to S1Orbit.ASCENDING. |
ASCENDING
|
Source code in src/geefetch/data/get.py
556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 | |
download_s2(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None, cloudless_portion=60, cloud_prb_thresh=40)
¶
Download Sentinel-2 images. Images are written in several .tif chips
to data_dir. Additionally, a file s2.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
cloudless_portion
|
int
|
Portion of the image expected to be cloudless.
See :meth: |
60
|
cloud_prb_thresh
|
int
|
Cloud probability threshold. See :meth: |
40
|
Source code in src/geefetch/data/get.py
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 | |
download_dynworld(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None)
¶
Download Dynamic World images. Images are written in several .tif chips
to data_dir. Additionnally a file dynworld.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
Source code in src/geefetch/data/get.py
download_landsat8(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=30, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None)
¶
Download Landsat 8 images. Images are written in several .tif chips
to data_dir. Additionally, a file landsat8.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 30. |
30
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
Source code in src/geefetch/data/get.py
download_palsar2(data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=30, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None, orbit=P2Orbit.DESCENDING)
¶
Download Palsar 2 images. Images are written in several .tif chips
to data_dir. Additionally, a file palsar2.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 30. |
30
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Geometry | None
|
More fine-grained AOI than |
None
|
orbit
|
P2Orbit
|
The orbit used to filter Palsar-2 images. Defaults to P2Orbit.ASCENDING. |
DESCENDING
|
Source code in src/geefetch/data/get.py
download_nasadem(data_dir, bbox, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None)
¶
Download NASADEM images. Images are written in several .tif chips
to data_dir. Additionally, a file nasadem.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Polygon | None
|
More fine-grained AOI than |
None
|
Source code in src/geefetch/data/get.py
download_custom(satellite_custom, data_dir, bbox, start_date, end_date, selected_bands=None, crs=None, resolution=10, tile_shape=500, max_tile_size=10, composite_method=CompositeMethod.MEDIAN, dtype=DType.Float32, filter_polygon=None)
¶
Download images from a custom data source. Images are written in several .tif chips
to data_dir. Additionally, a file nasadem.vrt is written to combine all the chips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
satellite_custom
|
CustomSatellite
|
|
required |
data_dir
|
Path
|
Directory to write the downloaded files to. |
required |
bbox
|
GeoBoundingBox
|
The box defining the region of interest. |
required |
start_date
|
str | None
|
The start date of the time period of interest. |
required |
end_date
|
str | None
|
The end date of the time period of interest. |
required |
selected_bands
|
list[str] | None
|
The bands to download. If None, the default satellite bands are used. |
None
|
crs
|
CRS | None
|
The CRS in which to download data. If None, AOI is split in UTM zones and data is downloaded in their local UTM zones. Defaults to None. |
None
|
resolution
|
int
|
Resolution of the downloaded data, in meters. Defaults to 10. |
10
|
tile_shape
|
int
|
Side length of a downloaded chip, in pixels. Defaults to 500. |
500
|
max_tile_size
|
int
|
Parameter adjusting the memory consumption in Google Earth Engine, in Mb. Choose the highest possible that doesn't raise a User Memory Excess error. Defaults to 10. |
10
|
composite_method
|
CompositeMethod
|
The composite method to mosaic the image collection. Can be CompositeMethod.TIMESERIES to download data as a time series instead of turning it into a mosaic. Defaults to CompositeMethod.MEDIAN. |
MEDIAN
|
dtype
|
DType
|
The data type of the downloaded images. Defaults to DType.Float32. |
Float32
|
filter_polygon
|
Polygon | None
|
More fine-grained AOI than |
None
|
Source code in src/geefetch/data/get.py
1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 | |