-
-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduces collection using median value and renders the reduced image as an EE raster layer.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import ee | ||
from qgis.core import QgsMapLayer | ||
|
||
from ee_plugin import Map | ||
|
||
|
||
def test_add_landsat_cloud_cover(clean_qgis_iface): | ||
collection = ( | ||
ee.ImageCollection("LANDSAT/LC09/C02/T1_L2") | ||
.filterDate("2021-01-01", "2021-12-31") | ||
.filter(ee.Filter.lt("CLOUD_COVER", 10)) | ||
) | ||
Map.addLayer(collection, {}, "LANDSAT_2021") | ||
layers = clean_qgis_iface.mapCanvas().layers() | ||
assert len(layers) == 1 | ||
assert layers[0] | ||
layer = layers[0] | ||
assert layer.name() == "LANDSAT_2021" | ||
assert layer.type() == QgsMapLayer.RasterLayer | ||
assert layer.providerType() == "EE" |