Package: ee-extra
A Python package that unifies the Google Earth Engine ecosystem.EarthEngine.jl|rgee|rgee+|eemontGitHub:https://github.com/r-earthengine/ee_extraDocumentation:https://ee-extra.readthedocs.ioPyPI:https://pypi.python.org/pypi/ee_extraConda-forge:https://anaconda.org/conda-forge/ee_extraOverviewGoogle Earth Engine(GEE) is a cloud-based service for
geospatial processing of vector and raster data. The Earth Engine platform has aJavaScript and a Python APIwith
different methods to process geospatial objects. Google Earth Engine also provides aHUGE PETABYTE-SCALE CATALOGof
raster and vector data that users can process online.There are a lot of fantastic third-party GEE packages and projects around GitHub. However,
most of them are coded in JavaScript or Python, and they are not straightforward
to translate to R, Julia, or other programming languages. The main goal ofeeExtrais
to guarantee a smoothimportof these projects in other programming languages by
standardizing different methods and enabling the use of JavaScript modules outside theCode Editor.Some of theeeExtrafeatures are listed here:Automatic scaling and offsetting.Spectral Indices computation (usingAwesome Spectral Indices).Clouds and shadows masking.STAC related functions.And the most important feature:Enabling the usage of JavaScript modules outside the Code Editor.How does it work?eeExtrais a Python package, just like any other, but it is aninjathat serves as a
methods provider for different environments: R, Julia and Python itself.eeExtraaccomplish this by being the powerhouse of some amazing packages such asrgee,rgee+, andeemont.Public JavaScript module can also be used outside the Code Editor in these packages
througheeExtra. For this,eeExtraimplements a rigorous JavaScript translation
module that allows users to install, require and use JavaScript modules as if they
were on the Code Editor!You may be wondering"Why is it a ninja package?", well, that's a valid question,
the whole point ofeeExtraresides in the fact that nobody has to useeeExtraitself,
but rather use one of the packages that are powered byeeExtra! :)InstallationInstall the latest version from PyPI:pip install ee_extraInstall soft ee_extra dependencies:pip install jsbeautifier regexUpgradeeeExtraby running:pip install -U ee_extraInstall the latest version from conda-forge:conda install -c conda-forge ee_extraInstall the latest dev version from GitHub by running:pip install git+https://github.com/r-earthengine/ee_extraFeaturesLet's see some of the awesome features ofeeExtraand how to use them from the powered
packages in python and R!Scale and OffsetMost datasets in the data catalog are scaled and in order to get their real values,
we have to scale (and sometimes offset) them!Python (eemont)R (rgee+)Julia (EarthEngine.jl)importee,eemontee.Initialize()db='COPERNICUS/S2_SR'S2=ee.ImageCollection(db)S2.scaleAndOffset()library(rgee)library(rgeeExtra)ee_Initialize()db<-'COPERNICUS/S2_SR'S2<-ee$ImageCollection(db)ee_extra_scaleAndOffset(S2)usingPyCallusingEarthEngineInitialize()ee_extra=pyimport("ee_extra")ee_core=ee_extra.STAC.coredb="COPERNICUS/S2_SR"S2=ee.ImageCollection(db)ee_core.scaleAndOffset(S2)Spectral IndicesDo you know theAwesome Spectral Indices?
Well, you can compute them automatically witheeExtra!Python (eemont)R (rgee+)Julia (EarthEngine.jl)importee,eemontee.Initialize()db='COPERNICUS/S2_SR'S2=ee.ImageCollection(db)S2=S2.scaleAndOffset()S2.spectralIndices("EVI")library(rgee)library(rgeeExtra)ee_Initialize()db<-'COPERNICUS/S2_SR'S2<-ee$ImageCollection(db)S2<-ee_extra_scaleAndOffset(S2)ee_extra_spIndices(S2,"EVI")usingPyCallusingEarthEngineInitialize()ee_extra=pyimport("ee_extra")ee_core=ee_extra.STAC.coreee_sp=ee_extra.Spectral.coredb="COPERNICUS/S2_SR"S2=ee.ImageCollection(db)S2=ee_core.scaleAndOffset(S2)ee_sp.spectralIndices(S2,"EVI")STAC featuresAccess STAC properties easily!Python (eemont)R (rgee+)Julia (EarthEngine.jl)importee,eemontee.Initialize()db='COPERNICUS/S2_SR'S2=ee.ImageCollection(db)S2.getSTAC()library(rgee)library(rgeeExtra)ee_Initialize()db<-'COPERNICUS/S2_SR'S2<-ee$ImageCollection(db)ee_extra_getSTAC()usingPyCallusingEarthEngineInitialize()ee_extra=pyimport("ee_extra")ee_core=ee_extra.STAC.coredb="COPERNICUS/S2_SR"S2=ee.ImageCollection(db)ee_core.getSTAC(S2)JavaScript ModulesThis is perhaps the most important feature ineeExtra! What if you could use a
JavaScript module (originally just useful for the Code Editor) in python or R? Well,
wait no more for it!JS Code Editorvarmod=require('users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js')vargeom=ee.Geometry.Rectangle(-8.91,40.0,-8.3,40.4)varLST=mod.collection("L8","2018-05-15","2018-05-31",geom,true)print(LST)Python eemontimportee,eemontee.Initialize()module='users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js'ee.install(module)mod=ee.require(module)geom=ee.Geometry.Rectangle(-8.91,40.0,-8.3,40.4)LST=mod.collection("L8","2018-05-15","2018-05-31",geom,True)print(LST)R rgeeExtralibrary(rgee)library(rgeeExtra)ee_Initialize()lsmod<-'users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js'mod<-module(lsmod)geom<-ee$Geometry$Rectangle(-8.91,40.0,-8.3,40.4)LST<-mod$collection("L8","2018-05-15","2018-05-31",geom,TRUE)print(LST)Julia EarthEngine.jlusingPyCallusingEarthEngineInitialize()ee_extra=pyimport("ee_extra")landsat_module="users/sofiaermida/landsat_smw_lst:modules/Landsat_LST.js"ee_extra.install(landsat_module)lsmodule=ee_extra.require(landsat_module)geom=Rectangle(-8.91,40.0,-8.3,40.4)LST=lsmodule.collection("L8","2018-05-15","2018-05-31",geom,true)print(LST)