def addLayer(fuel): # print(fuel) Map.addLayer( pp.filter(ee.Filter.eq('fuel1', fuel)).style({ 'styleProperty': 'styleProperty', 'neighborhood': 50 }), {}, fuel, True, 0.65)
def exportWithoutDate(layer, vizParams, output_name): if clipper != None: layer = clip_mask(layer) try: Map.centerObject(layer, 8) except: pass #Map.addLayer(layer, vizParams, '{}_{}'.format(prefix, output_name)) export(layer, "{}_{}".format(prefix, output_name))
def help_calculate(filter_data, date, vizParams, output_name, expression): data = filter_data if expression != None: layer = eval(expression) else: layer = data if clipper != None: layer = clip_mask(layer) try: Map.centerObject(layer, 8) except: pass #Map.addLayer(layer, vizParams, '{}_{}_{}'.format(prefix, date, output_name)) export(layer, "{}_{}_{}".format(prefix, date, output_name))
def identify(self, point, format, boundingBox=None, width=None, height=None, dpi=None): # TODO: speed-up, extend this to maintain cache of visible image, update cache on-the-fly when needed point = utils.geom_to_geo(point) point_ee = ee.Geometry.Point([point.x(), point.y()]) scale = Map.getScale() value = self.ee_object.reduceRegion(ee.Reducer.first(), point_ee, scale).getInfo() band_indices = range(1, self.bandCount() + 1) band_names = [ self.generateBandName(band_no) for band_no in band_indices ] band_values = [value[band_name] for band_name in band_names] value = dict(zip(band_indices, band_values)) result = QgsRasterIdentifyResult(QgsRaster.IdentifyFormatValue, value) return result
import ee from ee_plugin import Map dataset = ee.Image('CSP/ERGo/1_0/US/mTPI') usMtpi = dataset.select('elevation') usMtpiVis = { 'min': -200.0, 'max': 200.0, 'palette': ['0b1eff', '4be450', 'fffca4', 'ffa011', 'ff0000'], } Map.setCenter(-105.8636, 40.3439, 11) Map.addLayer(usMtpi, usMtpiVis, 'US mTPI')
import ee from ee_plugin import Map dataset = ee.Image('CSP/ERGo/1_0/US/physiography') physiography = dataset.select('constant') physiographyVis = { 'min': 1100.0, 'max': 4220.0, } Map.setCenter(-105.4248, 40.5242, 8) Map.addLayer(physiography, physiographyVis, 'Physiography')
from ee_plugin import Map from ee_plugin import palettes import ee dem = ee.Image("JAXA/ALOS/AW3D30_V1_1").select('MED') dem = dem.updateMask(dem.gt(0)) palette = palettes.cb['Pastel1']['7'] #palette = ['black', 'white'] rgb = dem.visualize(**{'min': 0, 'max': 5000, 'palette': palette}) hsv = rgb.unitScale(0, 255).rgbToHsv() extrusion = 30 weight = 0.3 hs = ee.Terrain.hillshade(dem.multiply(extrusion), 315, 35).unitScale(10, 250).resample('bicubic') hs = hs.multiply(1 - weight).add(hsv.select('value').multiply(weight)) hsv = hsv.addBands(hs.rename('value'), ['value'], True) rgb = hsv.hsvToRgb() Map.setCenter(0, 28, 2.5) Map.addLayer(rgb, {}, 'ALOS DEM', True)
return image.addBands(ndvi).addBands(mndwi).addBands(evi).addBands(lswi) # Map the function over one year of data. L8sr = ee.ImageCollection('LANDSAT/LC08/C01/T1_SR') \ .filterDate('2019-01-01', '2019-12-31') \ .filter(ee.Filter.lt("CLOUD_COVER", 30)) \ .map(maskL8sr) L8sr = L8sr.median().clip(ThaiBinh) # Compute multiple indices L8col = compute_indices(L8sr) print(L8col) # Display the results. Map.centerObject(ThaiBinh, 9) Map.addLayer(L8sr, {'bands': ['B4', 'B3', 'B2'], 'min': 0, 'max': 0.3}) # Map.addLayer(image, imageVisParam, 'True colour image') classNames = Mangrove.merge(Shrimp).merge(Residence).merge(Water).merge( Agriculture).merge(Other).merge(Evergreen) #print(classNames) bands = L8col.bandNames() training = L8col.select(bands).sampleRegions({ 'collection': classNames, 'properties': ['landcover'], 'scale': 30 }) #print(training) classifier = ee.Classifier.randomForest(100).train({ 'features': training,
import ee from ee_plugin import Map cover = ee.Image('MODIS/051/MCD12Q1/2012_01_01').select('Land_Cover_Type_1') igbpPalette = [ 'aec3d4', '152106', '225129', '369b47', '30eb5b', '387242', '6a2325', 'c3aa69', 'b76031', 'd9903d', '91af40', '111149', 'cdb33b', 'cc0013', '33280d', 'd7cdcc', 'f7e084', '6f6f6f' ] Map.setCenter(-99.229, 40.413, 5) Map.addLayer(cover, {'min': 0, 'max': 17, 'palette': igbpPalette}, 'MODIS Land Cover')
# GitHub URL: https://github.com/giswqs/qgis-earthengine-examples/tree/master/Datasets/Vectors/global_land_ice_measurements.py import ee from ee_plugin import Map dataset = ee.FeatureCollection('GLIMS/current') visParams = { 'palette': ['gray', 'cyan', 'blue'], 'min': 0.0, 'max': 10.0, 'opacity': 0.8, } image = ee.Image().float().paint(dataset, 'area') Map.setCenter(-35.618, 66.743, 7) Map.addLayer(image, visParams, 'GLIMS/current') # Map.addLayer(dataset, {}, 'for Inspector', False)
import ee from ee_plugin import Map from ee_plugin.contrib import palettes dem = ee.Image("AHN/AHN2_05M_RUW").convolve( ee.Kernel.gaussian(0.5, 0.3, 'meters')) extrusion = 3 weight = 0.7 palette = palettes.crameri['oleron'][50] rgb = dem.visualize(**{'min': 0, 'max': 3, 'palette': palette}) hsv = rgb.unitScale(0, 255).rgbToHsv() hs = ee.Terrain.hillshade(dem.multiply(extrusion), 315, 35).unitScale(0, 255) hs = hs.multiply(weight).add(hsv.select('value').multiply(1 - weight)) saturation = hsv.select('saturation').multiply(0.5) hsv = hsv.addBands(hs.rename('value'), ['value'], True) hsv = hsv.addBands(saturation, ['saturation'], True) rgb = hsv.hsvToRgb() # rgb = rgb.updateMask(dem.unitScale(0, 3)) Map.addLayer(rgb, {}, 'Dutch AHN DEM', True) Map.setCenter(4.5618, 52.1664, 18)
import ee from ee_plugin import Map #Filtrar por Pais coleccionLimites = ee.FeatureCollection("USDOS/LSIB/2017") filtropais = coleccionLimites.filter(ee.Filter.eq('COUNTRY_NA', 'Mexico')) Map.centerObject(filtropais,6) #Importar Coleccion SENTINEL 5P sentinel5P = ee.ImageCollection("COPERNICUS/S5P/NRTI/L3_NO2") #Obtener Concentracion de NO2 NO2 = sentinel5P.filterDate("2019-08-01","2019-08-30").select("NO2_column_number_density")\ .max().clip( filtropais) Map.addLayer(NO2,{'min':0,'max':0.0002,'palette':['black', 'blue', 'purple', 'cyan', 'green', 'yellow', 'red']},"NO2")
import ee from ee_plugin import Map # Center the map on an image. image = ee.Image('LANDSAT/LC08/C01/T1/LC08_044034_20130603') Map.addLayer(image, {'bands': ['B4', 'B3', 'B2'], 'max': 20000}) Map.centerObject(image)
#!/usr/bin/env python """Display an image given its ID.""" import ee from ee_plugin import Map image = ee.Image('srtm90_v4') vis_params = {'min': 0, 'max': 3000} Map.addLayer(image, vis_params, "SRTM") Map.setCenter(0, 0, 2)
import ee import math from ee_plugin import Map # Load a high-resolution NAIP image. image = ee.Image('USDA/NAIP/DOQQ/m_3712213_sw_10_1_20140613') # Zoom to San Francisco, display. Map.setCenter(-122.466123, 37.769833, 17) Map.addLayer(image, {'max': 255}, 'image') # Get the NIR band. nir = image.select('N') # Define a neighborhood with a kernel. square = ee.Kernel.square(**{'radius': 4}) # Compute entropy and display. entropy = nir.entropy(square) Map.addLayer(entropy, { 'min': 1, 'max': 5, 'palette': ['0000CC', 'CC0000'] }, 'entropy') # Compute the gray-level co-occurrence matrix (GLCM), get contrast. glcm = nir.glcmTexture(**{'size': 4}) contrast = glcm.select('N_contrast') Map.addLayer(contrast, { 'min': 0, 'max': 1500,
# GitHub URL: https://github.com/giswqs/qgis-earthengine-examples/tree/master/Image/find_image_by_path_row.py import ee from ee_plugin import Map # Load an image collection, filtered so it's not too much data. collection = ee.ImageCollection('LANDSAT/LT05/C01/T1') \ .filterDate('2008-01-01', '2008-12-31') \ .filter(ee.Filter.eq('WRS_PATH', 44)) \ .filter(ee.Filter.eq('WRS_ROW', 34)) # Compute the median in each band, each pixel. # Band names are B1_median, B2_median, etc. median = collection.reduce(ee.Reducer.median()) # The output is an Image. Add it to the map. vis_param = {'bands': ['B4_median', 'B3_median', 'B2_median'], 'gamma': 1.6} Map.setCenter(-122.3355, 37.7924, 9) Map.addLayer(median, vis_param, 'Median Image')
import ee from ee_plugin import Map image = ee.Image('USDA/NAIP/DOQQ/m_4609915_sw_14_1_20100629') Map.addLayer(image, {'bands': ['N', 'R', 'G']}, 'NAIP')
def func_mrj(image): date = ee.Date(image.get('system:time_start')) yearOffset = date.difference(ee.Date(start), 'year') ndvi = image.normalizedDifference(['B4', 'B3']) return ee.Image(1).addBands(yearOffset).addBands(ndvi).toDouble() \ .map(func_mrj) # Convert to an array. Give the axes names for more readable code. array = images.toArray() imageAxis = 0 bandAxis = 1 # Slice off the year and ndvi, and solve for the coefficients. x = array.arraySlice(bandAxis, 0, 2) y = array.arraySlice(bandAxis, 2) fit = x.matrixSolve(y) # Get the coefficient for the year, effectively the slope of the long-term # NDVI trend. slope = fit.arrayGet([1, 0]) Map.setCenter(lng, lat, 12) Map.addLayer(slope, {'min': -0.03, 'max': 0.03}, 'Slope')
# GitHub URL: https://github.com/giswqs/qgis-earthengine-examples/tree/master/Datasets/Vectors/us_census_states.py #!/usr/bin/env python """Display US States. """ import ee from ee_plugin import Map fc = ee.FeatureCollection('TIGER/2018/States') # .filter(ee.Filter.eq('STUSPS', 'MN')) image = ee.Image().paint(fc, 0, 2) Map.setCenter(-99.844, 37.649, 5) Map.addLayer(image, {'palette': 'FF0000'}, 'TIGER/2018/States') # Map.addLayer(fc, {}, 'US States')
import ee from ee_plugin import Map # This example demonstrates the use of the Landsat 8 QA band to mask clouds. # Function to mask clouds using the quality band of Landsat 8. def maskL8(image): qa = image.select('BQA') #/ Check that the cloud bit is off. # See https:#www.usgs.gov/land-resources/nli/landsat/landsat-collection-1-level-1-quality-assessment-band mask = qa.bitwiseAnd(1 << 4).eq(0) return image.updateMask(mask) # Map the function over one year of Landsat 8 TOA data and take the median. composite = ee.ImageCollection('LANDSAT/LC08/C01/T1_TOA') \ .filterDate('2016-01-01', '2016-12-31') \ .map(maskL8) \ .median() # Display the results in a cloudy place. Map.setCenter(114.1689, 22.2986, 12) Map.addLayer(composite, {'bands': ['B4', 'B3', 'B2'], 'max': 0.3})
} ano = '2018' limitCaatC5 = ee.FeatureCollection(param['assetlimit']) FeatColbacia = ee.FeatureCollection(param['assetBaciaC4']) Mosaicos = ee.ImageCollection(param['assetMosaic']).filter( ee.Filter.Or( ee.Filter.eq("biome", 'CAATINGA'), ee.Filter.eq("biome", 'CERRADO'), ee.Filter.eq("biome", 'MATAATLANTICA') ))\ .filterBounds(FeatColbacia).select(param['bandas'])\ .filter(ee.Filter.eq('year', int(ano))).mosaic()\ .clip(FeatColbacia).divide(10) imgMap5_0 = ee.Image(param['assetCol5']).clip(limitCaatC5).select('classification_' + ano) FeatBacias = ee.Image().byte().paint(FeatColbacia, 1, 1) Featlimit = ee.Image().byte().paint(limitCaatC5, 1, 2) # Map.addLayer(imgMap5_0, {min:1, max: 45, 'palette': paleta }, 'Col5') Map.addLayer(imgMap5_0.visualize(**visualizar['visclassC5'])) # Map.addLayer(Featlimit, {'palette': '0000FF','opacity': 0.75}, 'lCaatinga') # Map.addLayer(FeatBacias, {'palette': 'FF0000', 'opacity': 0.8}, 'Bacias') # Map.addLayer(Mosaicos.visualize(**visualizar['visMosaic'])) #Center to point Map.centerObject(limitCaatC5, 6)
import ee from ee_plugin import Map dataset = ee.Image('CSP/ERGo/1_0/US/landforms') landforms = dataset.select('constant') landformsVis = { 'min': 11.0, 'max': 42.0, 'palette': [ '141414', '383838', '808080', 'EBEB8F', 'F7D311', 'AA0000', 'D89382', 'DDC9C9', 'DCCDCE', '1C6330', '68AA63', 'B5C98E', 'E1F0E5', 'a975ba', '6f198c' ], } Map.setCenter(-105.58, 40.5498, 11) Map.addLayer(landforms, landformsVis, 'NED Landforms')
rotation = eigenVectors.transpose() \ .matrixMultiply(scaled) \ .matrixMultiply(eigenVectors) # Reshape the 1-D 'normalized' array, so we can left matrix multiply # with the rotation. This requires embedding it in 2-D space and # transposing. transposed = centered.arrayRepeat(bandAxis, 1).arrayTranspose() # Convert rotated results to 3 RGB bands, and shift the mean to 127. return transposed.matrixMultiply(ee.Image(rotation)) \ .arrayProject([bandAxis]) \ .arrayFlatten([bandNames]) \ .add(127).byte() image = ee.Image('MODIS/006/MCD43A4/2002_07_04') Map.setCenter(-52.09717, -7.03548, 7) # View the original bland image. rgb = [0, 3, 2] Map.addLayer(image.select(rgb), {'min': -100, 'max': 2000}, 'Original Image') # Stretch the values within an interesting region. region = ee.Geometry.Rectangle(-57.04651, -8.91823, -47.24121, -5.13531) Map.addLayer(dcs(image, region, 1000).select(rgb), {}, 'DCS Image') # Display the region in which covariance stats were computed. Map.addLayer(ee.Image().paint(region, 0, 2), {}, 'Region')
.count() # Map the cloud masking function over the collection. collectionCloudMasked = collection.map(maskClouds) # Get the total number of observations for non-cloudy pixels for the time # interval. The result is unmasked to set to unity so that all locations # have counts, and the ratios later computed have values everywhere. clearObsCount = collectionCloudMasked \ .select('num_observations_1km') \ .count() \ .unmask(0) Map.addLayer( collectionCloudMasked.median(), { 'bands': ['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03'], 'gain': 0.07, 'gamma': 1.4 }, 'median of masked collection') Map.addLayer(totalObsCount, { 'min': 84, 'max': 92 }, 'count of total observations', False) Map.addLayer(clearObsCount, { 'min': 0, 'max': 90 }, 'count of clear observations', False) Map.addLayer(clearObsCount.toFloat().divide(totalObsCount), { 'min': 0, 'max': 1 }, 'ratio of clear to total observations')
# GitHub URL: https://github.com/giswqs/qgis-earthengine-examples/tree/master/Image/cell_statistics.py import ee from ee_plugin import Map # Load an image and select some bands of interest. image = ee.Image('LANDSAT/LC8_L1T/LC80440342014077LGN00') \ .select(['B4', 'B3', 'B2']) # Reduce the image to get a one-band maximum value image. maxValue = image.reduce(ee.Reducer.max()) # Display the result. Map.centerObject(image, 10) Map.addLayer(maxValue, {'max': 13000}, 'Maximum value image')
# Mask the sources image with itself. sources = sources.updateMask(sources) # The cost data is generated from classes in ESA/GLOBCOVER. cover = ee.Image('ESA/GLOBCOVER_L4_200901_200912_V2_3').select(0) # Classes 60, 80, 110, 140 have cost 1. # Classes 40, 90, 120, 130, 170 have cost 2. # Classes 50, 70, 150, 160 have cost 3. cost = \ cover.eq(60).Or(cover.eq(80)).Or(cover.eq(110)).Or(cover.eq(140)) \ .multiply(1).add( cover.eq(40).Or(cover.eq(90)).Or(cover.eq(120)).Or(cover.eq(130)) \ .Or(cover.eq(170)) \ .multiply(2).add( cover.eq(50).Or(cover.eq(70)).Or(cover.eq(150)).Or(cover.eq(160)) \ .multiply(3))) # Compute the cumulative cost to traverse the lAnd cover. cumulativeCost = cost.cumulativeCost(**{ 'source': sources, 'maxDistance': 80 * 1000 # 80 kilometers }) # Display the results Map.setCenter(18.71, 4.2, 9) Map.addLayer(cover, {}, 'Globcover') Map.addLayer(cumulativeCost, {'min': 0, 'max': 5e4}, 'accumulated cost') Map.addLayer(geometry, {'color': 'FF0000'}, 'source geometry')
# we have to do some kind of reduction, but it won't really calculate pixels # if we only access the band names. bandNames = bands.min().bandNames().slice(1) return best.arrayProject([bandAxis]).arrayFlatten([bandNames]) # Load the l7_l1t collection for the year 2000, and make sure the first band # is our quality measure, in this case the normalized difference values. l7 = ee.ImageCollection('LANDSAT/LE07/C01/T1') \ .filterDate('2000-01-01', '2001-01-01') def func_tqs(image): return image.normalizedDifference(['B4', 'B3']).addBands(image) withNd = l7.map(func_tqs) # Build a mosaic using the NDVI of bands 4 and 3, essentially showing the # greenest pixels from the year 2000. greenest = qualityMosaic(withNd) # Select out the color bands to visualize. An interesting artifact of this # approach is that clouds are greener than water. So all the water is white. rgb = greenest.select(['B3', 'B2', 'B1']) Map.addLayer(rgb, {'gain': [1.4, 1.4, 1.1]}, 'Greenest') Map.setCenter(-90.08789, 16.38339, 11)
def run(self): """Run method that performs all the real work""" def blankPaint(geometry): blank = ee.Image(0).mask(0) geometryDraw = blank.paint(geometry, '0000AA', 1) return geometryDraw # Create the dialog with elements (after translation) and keep reference # Only create GUI ONCE in callback, so that it will only load when the plugin is started if self.first_start == True: self.first_start = False self.dlg = simex_pluginDialog() # show the dialog self.dlg.show() # Run the dialog event loop result = self.dlg.exec_() # See if OK was pressed if result: uf = self.dlg.selectUF.currentText() path = self.dlg.path.toPlainText() row = self.dlg.row.toPlainText() cloud_cover = int(self.dlg.cloudcover.cleanText()) startdate = self.dlg.startdate.date().toString('yyyy-MM-dd') enddate = self.dlg.enddate.date().toString('yyyy-MM-dd') self.iface.messageBar().pushMessage('loading ...') geometry = path_row_am.filterMetadata('PATH', 'equals', int(path)).filterMetadata('ROW', 'equals', int(row)).geometry() countourGeometry = blankPaint(geometry) Map.centerObject(geometry, 100) progressMessageBar = iface.messageBar().createMessage("loading...") progress = QProgressBar() progress.setMaximum(10) progress.setAlignment(Qt.AlignLeft|Qt.AlignVCenter) progressMessageBar.layout().addWidget(progress) iface.messageBar().pushWidget(progressMessageBar, Qgis.Info) for i in range(10): time.sleep(1) progress.setValue(i + 1) parametrosColecaoL8 = { 'collectionid': 'LANDSAT/LC08/C01/T1_SR', 'geometry': geometry.centroid(), 'dateStart': ee.Date(startdate), 'dateEnd': ee.Date(enddate), 'cloud_cover': cloud_cover, } colecaoL8 = getCollection(parametrosColecaoL8).select(bandNames("l8")['bandNames'],bandNames("l8")['newNames'])\ .map(getSMA).map(getNDFI) #nImages = colecaoL8.size().getInfo() #colList = colecaoL8.toList(nImages) #idG = 1 listYears = list(range(int(startdate[:4]),int(enddate[:4])+1)) for item in listYears: #imgYear = ee.Image(colecaoL8.filterDate(str(item) + '-01-01',str(item+1) + '-01-01').sort('cloud_cover').first()) colYear = colecaoL8.filterDate(str(item) + '-01-01',str(item+1) + '-01-01').sort('cloud_cover').limit(3) colList = colYear.toList(5) idG = 1 while idG < 3: img = ee.Image(colList.get(idG)) try: dictionaryInfos = ee.Dictionary({'satellite_name':img.get('satellite_name'), 'date':img.get('date'), 'cloud_cover':img.get('cloud_cover')}).getInfo() if listYears.index(item) == len(listYears)-2: status = True else: status = False Map.addLayer(img, {'bands': ['swir2'],'gain' : [0.2],'gamma':0.6},\ 'B7_' + str(dictionaryInfos['date']).replace('-','_')+'_'+dictionaryInfos['satellite_name'],status) Map.addLayer(img,{"bands": ['ndfi'], "palette": ['ffffff', 'fffcff', 'fff9ff', 'fff7ff', 'fff4ff', 'fff2ff', 'ffefff', 'ffecff', 'ffeaff', 'ffe7ff', 'ffe5ff', 'ffe2ff', 'ffe0ff', 'ffddff', 'ffdaff', 'ffd8ff', 'ffd5ff', 'ffd3ff', 'ffd0ff', 'ffceff', 'ffcbff', 'ffc8ff', 'ffc6ff', 'ffc3ff', 'ffc1ff', 'ffbeff', 'ffbcff', 'ffb9ff', 'ffb6ff', 'ffb4ff', 'ffb1ff', 'ffafff', 'ffacff', 'ffaaff', 'ffa7ff', 'ffa4ff', 'ffa2ff', 'ff9fff', 'ff9dff', 'ff9aff', 'ff97ff', 'ff95ff', 'ff92ff', 'ff90ff', 'ff8dff', 'ff8bff', 'ff88ff', 'ff85ff', 'ff83ff', 'ff80ff', 'ff7eff', 'ff7bff', 'ff79ff', 'ff76ff', 'ff73ff', 'ff71ff', 'ff6eff', 'ff6cff', 'ff69ff', 'ff67ff', 'ff64ff', 'ff61ff', 'ff5fff', 'ff5cff', 'ff5aff', 'ff57ff', 'ff55ff', 'ff52ff', 'ff4fff', 'ff4dff', 'ff4aff', 'ff48ff', 'ff45ff', 'ff42ff', 'ff40ff', 'ff3dff', 'ff3bff', 'ff38ff', 'ff36ff', 'ff33ff', 'ff30ff', 'ff2eff', 'ff2bff', 'ff29ff', 'ff26ff', 'ff24ff', 'ff21ff', 'ff1eff', 'ff1cff', 'ff19ff', 'ff17ff', 'ff14ff', 'ff12ff', 'ff0fff', 'ff0cff', 'ff0aff', 'ff07ff', 'ff05ff', 'ff02ff', 'ff00ff', 'ff00ff', 'ff0af4', 'ff15e9', 'ff1fdf', 'ff2ad4', 'ff35c9', 'ff3fbf', 'ff4ab4', 'ff55aa', 'ff5f9f', 'ff6a94', 'ff748a', 'ff7f7f', 'ff8a74', 'ff946a', 'ff9f5f', 'ffaa55', 'ffb44a', 'ffbf3f', 'ffc935', 'ffd42a', 'ffdf1f', 'ffe915', 'fff40a', 'ffff00', 'ffff00', 'fffb00', 'fff700', 'fff300', 'fff000', 'ffec00', 'ffe800', 'ffe400', 'ffe100', 'ffdd00', 'ffd900', 'ffd500', 'ffd200', 'ffce00', 'ffca00', 'ffc600', 'ffc300', 'ffbf00', 'ffbb00', 'ffb700', 'ffb400', 'ffb000', 'ffac00', 'ffa800', 'ffa500', 'ffa500', 'f7a400', 'f0a300', 'e8a200', 'e1a200', 'd9a100', 'd2a000', 'ca9f00', 'c39f00', 'bb9e00', 'b49d00', 'ac9c00', 'a59c00', '9d9b00', '969a00', '8e9900', '879900', '7f9800', '789700', '709700', '699600', '619500', '5a9400', '529400', '4b9300', '439200', '349100', '2d9000', '258f00', '1e8e00', '168e00', '0f8d00', '078c00', '008c00', '008c00', '008700', '008300', '007f00', '007a00', '007600', '007200', '006e00', '006900', '006500', '006100', '005c00', '005800', '005400', '005000', '004c00'],\ "min":0,"max":200},'NDFI_' + str(dictionaryInfos['date']).replace('-','_')+'_'+dictionaryInfos['satellite_name'],status) except Exception as e: # print('Exception\n',str(e)) pass idG = idG + 1 for i in range(10): time.sleep(1) progress.setValue(i + 1) iface.messageBar().clearWidgets() Map.addLayer(countourGeometry,{ 'palette': '#000000', 'opacity': 0.8 },str(path) + '_' + str(row)) for item in auxLayers[dicAuxState[uf]][0]: outline = blankPaint(auxLayers[dicAuxState[uf]][item][1][1]) Map.addLayer(outline,auxLayers[dicAuxState[uf]][item][1][3],\ auxLayers[dicAuxState[uf]][item][1][2], False)
import ee from ee_plugin import Map # Compute Enhanced Vegetation Index (EVI) over the MODIS MOD09GA product # using an expression. # Load a MODIS image and apply the scaling factor. img = ee.Image('MODIS/006/MOD09GA/2012_03_09').multiply(0.0001) # Compute EVI using an expression. The second argument is a map from # variable name to band name in the input image. evi = img.expression( '2.5 * (nir - red) / (nir + 6 * red - 7.5 * blue + 1)', { 'red': img.select('sur_refl_b01'), # 620-670nm, RED 'nir': img.select('sur_refl_b02'), # 841-876nm, NIR 'blue': img.select('sur_refl_b03') # 459-479nm, BLUE }) # Center the map. Map.setCenter(-94.84497, 39.01918, 8) # Display the input image and the EVI computed from it. Map.addLayer(img.select(['sur_refl_b01', 'sur_refl_b04', 'sur_refl_b03']), { 'min': 0, 'max': 0.2 }, 'MODIS bands 1/4/3') Map.addLayer(evi, {'min': 0, 'max': 1}, 'EVI')
# GitHub URL: https://github.com/giswqs/qgis-earthengine-examples/tree/master/Filter/filter_string_starts_with.py import ee from ee_plugin import Map states = ee.FeatureCollection('TIGER/2018/States') # Select states its name starting with 'Al' selected = states.filter(ee.Filter.stringStartsWith('NAME', 'Al')) Map.centerObject(selected, 6) Map.addLayer(ee.Image().paint(selected, 0, 2), {'palette': 'yellow'}, 'Selected')