120 javascript
Run the following line to enable tab-completion for JavaScript libraries.
In [ ]:
Copied!
%config IPCompleter.use_jedi = False
%config IPCompleter.use_jedi = False
Import libraries
In [ ]:
Copied!
import ee
import geemap
import ee
import geemap
In [ ]:
Copied!
geemap.ee_initialize()
geemap.ee_initialize()
Use the Open Earth Engine Library (OEEL)
In [ ]:
Copied!
oeel = geemap.requireJS()
oeel = geemap.requireJS()
In [ ]:
Copied!
ic = ee.ImageCollection("COPERNICUS/S2_SR")
icSize = (
oeel.Algorithms.Sentinel2.cloudfree(maxCloud=20, S2Collection=ic)
.filterDate('2020-01-01', '2020-01-02')
.size()
)
print('Cloud free imagery: ', icSize.getInfo())
ic = ee.ImageCollection("COPERNICUS/S2_SR")
icSize = (
oeel.Algorithms.Sentinel2.cloudfree(maxCloud=20, S2Collection=ic)
.filterDate('2020-01-01', '2020-01-02')
.size()
)
print('Cloud free imagery: ', icSize.getInfo())
Use an Earth Engine JavaScript library from a HTTP URL.
In [ ]:
Copied!
url = 'https://github.com/gee-community/geemap/blob/master/examples/javascripts/grid.js'
url = 'https://github.com/gee-community/geemap/blob/master/examples/javascripts/grid.js'
In [ ]:
Copied!
lib = geemap.requireJS(url)
lib = geemap.requireJS(url)
In [ ]:
Copied!
lib.availability
lib.availability
In [ ]:
Copied!
grid = lib.generateGrid(-180, -50, 180, 50, 10, 10, 0, 0)
grid = lib.generateGrid(-180, -50, 180, 50, 10, 10, 0, 0)
In [ ]:
Copied!
Map = geemap.Map()
Map.addLayer(grid, {}, 'Grid')
Map
Map = geemap.Map()
Map.addLayer(grid, {}, 'Grid')
Map
Use a local Earth Engine JavaScript library.
In [ ]:
Copied!
Map = geemap.Map()
Map
Map = geemap.Map()
Map
In [ ]:
Copied!
lib = geemap.requireJS('grid.js', Map)
lib = geemap.requireJS('grid.js', Map)
In [ ]:
Copied!
lib.availability
lib.availability
In [ ]:
Copied!
lib.grid_test()
lib.grid_test()
Use an Earth Engine JavaScript from an Earth Engine repo.
In [ ]:
Copied!
lib = geemap.requireJS('users/gena/packages:grid')
lib = geemap.requireJS('users/gena/packages:grid')
In [ ]:
Copied!
lib.availability
lib.availability
In [ ]:
Copied!
grid = lib.generateGrid(-180, -50, 180, 50, 10, 10, 0, 0)
grid = lib.generateGrid(-180, -50, 180, 50, 10, 10, 0, 0)
In [ ]:
Copied!
Map = geemap.Map()
Map.addLayer(grid, {}, 'Grid')
Map
Map = geemap.Map()
Map.addLayer(grid, {}, 'Grid')
Map
Last update:
2023-04-06
Created: 2021-12-18
Created: 2021-12-18