geetools.ComputedObject.save#

geetools.ComputedObject.save(self, path)#

Save a ComputedObject to a .gee file.

The file contains the JSON representation of the object. it still need to be computed via getInfo() to be used.

Parameters:

path (geetools.types.pathlike) – The path to save the object to.

Returns:

The path to the saved file.

Return type:

pathlib.Path

Examples

import ee, geetools
from tempfile import TemporaryDirectory
from pathlib import Path

ee.Initialize()

img = ee.Image("COPERNICUS/S2/20151128T112653_20151128T135750_T29SND")
with TemporaryDirectory() as tmp:
    file = Path(tmp) / "test.gee"
    img.geetools.save(file)
    print(file.readText())