Layout of the extensions#
Overview#
This section is a glossary of all the methods that are added to ee
objects by the extension.
They are gathered by sections and link to the API reference for detailed examples but give a good overview of what can be done.
If you search for a method in the package, note that we decided to use names that are meaningful for python users so if you know what you are looking for in rasterio
, pandas
or numpy
you should be able to find it here under the same name.
Warning
Method that were replaced during refactoring or that are still not reimplemented are not listed here. They remain fully accecible in the geetools package. If they raise a deprecation warning, it means that they are still available but will be removed in the future by their extension equivalent.
Earth Engine classes#
ee.Array#
As reported in gee-community/geetools#173, this object cannot be extended before the API of Earth Enfine is initialized. So to use the following methods, you will be forced to manually import the following:
from geetools.Array import ArrayAccessor
constructor#
ee.Array.geetools.full
: Create an array with the given dimensions, initialized to the given value. Manually loaded
data manipulation#
ee.Array.geetools.set
: Set the value of a cell in an array. Manually be loaded
ee.Authenticate#
ee.Authenticate.geetools.new_user
: Authenticate the user and save the credentials in a specific folder.ee.Authenticate.geetools.delete_user
: Delete a user credential file.ee.Authenticate.geetools.list_user
: return all the available users in the set folder.ee.Authenticate.geetools.rename_user
: Rename a user without changing the credentials.
ee.ComputedObject#
The ee.ComputedObject
is the base object of all API object. The methods added here can thus be used in every object of the API.
That’s also the only Object where the methods are directly added as members without the need to call geetools before.
Types management#
ee.ComputedObject.isInstance
: Return 1 if the element is the passed type or 0 if not.
save json representations#
ee.ComputedObject.save
: Save a ``ComputedObject`` to a .gee file.ee.ComputedObject.open
: Open a .gee file as a ComputedObject.
ee.Date#
Constructors#
ee.Date.geetools.fromEpoch
: Set an the number of units since epoch (1970-01-01).ee.Date.geetools.fromDOY
: Create a date from a day of year and a year.
Extra operations#
ee.Date.geetools.getUnitSinceEpoch
: Get the number of units since epoch (1970-01-01).ee.Date.geetools.isLeap
: Check if the year of the date is a leap year.
Exportation#
Warning
As the snake case suggests, this method is client side.
ee.Date.geetools.to_datetime
: Convert a ``ee.Date`` to a ``datetime.datetime``.
helper#
ee.Date.geetools.check_unit
: Check if the provided value is a valid time unit.
ee.DateRange#
As reported in gee-community/geetools#206, this object cannot be extended before the API of Earth Enfine is initialized. So to use the following methods, you will be forced to manually import the following:
from geetools.DateRange import DateRangeAccessor
Extra operations#
ee.DateRange.geetools.split
: Convert aee.DateRange
to a list ofee.DateRange
.`
Helper#
ee.DateRange.geetools.check_unit
: Check if the unit is valid.ee.DateRange.geetools.unitMillis
: Get the milliseconds of a unit.
ee.Dictionary#
Constructors#
ee.Dictionary.geetools.fromPairs
: Create a dictionary from a list of [[key, value], …]] pairs.
Extra operations#
ee.Dictionary.geetools.sort
: Sort the dictionary by keys in ascending order.ee.Dictionary.geetools.getMany
: Extract values from a list of keys.
ee.Feature#
ee.Feature.geetools.toFeatureCollection
: Convert a feature composed of a multiGeometry geometry into a FEatureCollection.ee.Feature.geetools.removeProperties
: Remove properties from a feature.
ee.FeatureCollection#
Properties management#
ee.FeatureCollection.geetools.addId
: Add a unique numeric identifier, starting from parameter ``start``.
Geometry management#
ee.FeatureCollection.geetools.mergeGeometries
: Merge the geometries the included features.ee.FeatureCollection.geetools.toPolygons
: Drop any geometry that is not a Polygon or a multipolygon.
Converter#
ee.FeatureCollection.geetools.toImage
: Paint the current FeatureCollection to an Image.ee.FeatureCollection.geetools.byFeatures
: Get a dictionary with all property values for each feature.ee.FeatureCollection.geetools.byProperties
: Get a dictionary with all feature values for each properties.
Plotting#
ee.FeatureCollection.geetools.plot_by_features
: Plot the values of a ``ee.FeatureCollection`` by feature.ee.FeatureCollection.geetools.plot_by_properties
: Plot the values of a FeatureCollection by property.ee.FeatureCollection.geetools.plot_hist
: Plot the histogram of a specific property.
ee.Filter#
ee.Filter.geetools.dateRange
: Filter by daterange.
ee.Geometry#
ee.Geometry.geetools.keepType
: Only keep the geometries of the given type from a GeometryCollection.
ee.Image#
Constructor#
ee.Image.geetools.full
: Create an image with the given values and names.ee.Image.geetools.fullLike
: Create an image with the same band names, projection and scale as the original image.
Band manipulation#
ee.Image.geetools.addDate
: Add a band with the date of the image in the provided format.ee.Image.geetools.addSuffix
: Add a suffix to the image selected band.ee.Image.geetools.addPrefix
: Add a prefix to the image selected band.ee.Image.geetools.rename
: Rename the bands of the image based on a dictionary.ee.Image.geetools.remove
: Remove bands from the image.ee.Image.geetools.doyToDate
: Convert the DOY band to a date band.ee.Image.geetools.negativeClip
: The opposite of the clip method.ee.Image.geetools.gauss
: Apply a gaussian filter to the image.ee.Image.geetools.repeat
: Repeat a band of the image.
Data extraction#
ee.Image.geetools.getValues
: Get the value of the image at the given point using specified geometry.ee.Image.geetools.minScale
: Return the minimum scale of the image.ee.Image.geetools.reduceBands
: Reduce the image using the selected reducer and adding the result as a band using the selected name.ee.Image.geetools.format
: Create a string from using the given pattern and using the image properties.ee.Image.geetools.index_list
: Return the list of indices implemented in this module.ee.Image.geetools.spectralIndices
: Computes one or more spectral indices (indices are added as bands) for an image from the Awesome List of Spectral Indices.ee.Image.geetools.getScaleParams
: Gets the scale parameters for each band of the image.ee.Image.geetools.getOffsetParams
: Gets the offset parameters for each band of the image.ee.Image.geetools.getSTAC
: Gets the STAC of the image.ee.Image.geetools.getDOI
: Gets the DOI of the image, if available.ee.Image.geetools.getCitation
: Gets the citation of the image, if available.
Data manipulation#
ee.Image.geetools.doyToDate
: Convert the DOY band to a date band.ee.Image.geetools.clipOnCollection
: Clip an image to a FeatureCollection.ee.Image.geetools.bufferMask
: Make a buffer around every masked pixel of the Image.ee.Image.geetools.removeZeros
: Return an image array with non-zero values extracted from each band.ee.Image.geetools.interpolateBands
: Interpolate bands from the “src” value range to the “to” value range.ee.Image.geetools.isletMask
: Compute the islet mask from an image.ee.Image.geetools.scaleAndOffset
: Scales bands on an image according to their scale and offset parameters.ee.Image.geetools.preprocess
: Pre-processes the image: masks clouds and shadows, and scales and offsets the image.ee.Image.geetools.panSharpen
: Apply panchromatic sharpening to the Image.ee.Image.geetools.tasseledCap
: Calculates tasseled cap brightness, wetness, and greenness components.ee.Image.geetools.matchHistogram
: Adjust the image’s histogram to match a target image.ee.Image.geetools.maskClouds
: Masks clouds and shadows in an image (valid just for Surface Reflectance products).
Converter#
ee.Image.geetools.toGrid
: Convert an image to a grid of polygons.
Properties#
ee.Image.geetools.removeProperties
: Remove a list of properties from an image.
ee.ImageCollection#
Data manipulation#
ee.ImageCollection.geetools.maskClouds
: Masks clouds and shadows in each image of an ImageCollection (valid just for Surface Reflectance products).ee.ImageCollection.geetools.closest
: Gets the closest image (or set of images if the collection intersects a region that requires multiple scenes) to the specified date.ee.ImageCollection.geetools.scaleAndOffset
: Scales bands on an image according to their scale and offset parameters.ee.ImageCollection.geetools.preprocess
: Pre-processes the image: masks clouds and shadows, and scales and offsets the image.ee.ImageCollection.geetools.panSharpen
: Apply panchromatic sharpening to the ImageCollection images.ee.ImageCollection.geetools.tasseledCap
: Calculates tasseled cap brightness, wetness, and greenness components.ee.ImageCollection.geetools.append
: Append an image to the existing image collection.ee.ImageCollection.geetools.outliers
: Compute the outlier for each pixel in the specified bands.
Data extraction#
ee.ImageCollection.geetools.spectralIndices
: Computes one or more spectral indices (indices are added as bands) for an image from the Awesome List of Spectral Indices.ee.ImageCollection.geetools.getScaleParams
: Gets the scale parameters for each band of the image.ee.ImageCollection.geetools.getOffsetParams
: Gets the offset parameters for each band of the image.ee.ImageCollection.geetools.getDOI
: Gets the DOI of the collection, if available.ee.ImageCollection.geetools.getCitation
: Gets the citation of the image, if available.ee.ImageCollection.geetools.getSTAC
: Gets the STAC of the image.ee.ImageCollection.geetools.collectionMask
: A binary ee.Image where only pixels that are masked in all images of the collection get masked.ee.ImageCollection.geetools.iloc
: Get Image from the ImageCollection by index.ee.ImageCollection.geetools.integral
: Compute the integral of a band over time or a specified property.
Converter#
ee.ImageCollection.geetools.to_xarray
: Open an Earth Engine ImageCollection as an ``xarray.Dataset``.
ee.Initialize#
ee.Initialize.geetools.from_user
: Initialize Earthengine API using a specific user.ee.Initialize.geetools.project_id
: Get the project_id of the current account.
ee.Join#
ee.Join.geetools.byProperty
: Join 2 collections by a given property field.
ee.List#
Constructor#
ee.List.geetools.sequence
: Create a sequence from ini to end by step.ee.List.geetools.zip
: Zip a list of lists.
operations#
ee.List.geetools.product
: Compute the cartesian product of 2 list.ee.List.geetools.complement
: Compute the complement of the current list and the ``other`` list.ee.List.geetools.intersection
: Compute the intersection of the current list and the ``other`` list.ee.List.geetools.union
: Compute the union of the current list and the ``other`` list.ee.List.geetools.delete
: Delete an element from a list.ee.List.geetools.replaceMany
: Replace many values in a list.
Converter#
ee.List.geetools.join
: Format a list to a string.ee.List.geetools.toStrings
: Convert elements of a list into Strings.
ee.Number#
ee.Number.geetools.truncate
: Truncate a number to a given number of decimals.
ee.String#
ee.String.geetools.eq
: Compare two strings and return a ``ee.Number``.ee.String.geetools.format
: Format a string with a dictionary.
Added classes#
ee.Float#
Note
This object does not exist in the original API. It is a custom Placeholder Float class to be used in the ee.ComputedObject.isInstance
method.
ee.Integer#
Note
This object does not exist in the original API. It is a custom Placeholder Float class to be used in the ee.ComputedObject.isInstance
method.
ee.Asset#
Note
This object is overriding most of the pathlib methods. We are simply gathering them here for convenience.
Constructor#
ee.Asset.home
: Return the root asset folder of the used cloud project.
Operation#
ee.Asset.as_posix
: Return the asset id as a posix path.ee.Asset.as_uri
: Return the asset id as a uri.ee.Asset.is_absolute
: Return True if the asset is absolute.ee.Asset.is_user_project
: Check if the current asset is in the same project as the user.ee.Asset.expanduser
: Return a new path with expanded ~ constructs.ee.Asset.exists
: Return True if the asset exists and/or the user has access to it.ee.Asset.is_relative_to
: Return True if the asset is relative to another asset.ee.Asset.joinpath
: Join the asset with other paths.ee.Asset.match
: Return True if the asset matches the patterns.ee.Asset.with_name
: Return the asset with the given name.ee.Asset.is_image
: Return ``True`` if the asset is an image.ee.Asset.is_image_collection
: Return ``True`` if the asset is an image collection.ee.Asset.is_feature_collection
: Return ``True`` if the asset is a feature collection.ee.Asset.is_folder
: Return ``True`` if the asset is a folder.ee.Asset.is_project
: Return ``True`` if the asset is a project.ee.Asset.is_type
: Return ``True`` if the asset is of the specified type.ee.Asset.iterdir
: Get the list of children of a folder.ee.Asset.mkdir
: Create a folder asset from the Asset path.ee.Asset.move
: Move the asset to a target destination.ee.Asset.rmdir
: Remove the asset folder.ee.Asset.unlink
: Remove the asset.ee.Asset.delete
: Alias for unlink.ee.Asset.copy
: Copy the asset to a target destination.ee.Asset.glob
: Return a list of assets matching the pattern.ee.Asset.rglob
: Return a list of assets matching the pattern recursively.
Property#
ee.Asset.parts
: Return the asset parts of the path.ee.Asset.parent
: Return the direct parent directory.ee.Asset.parents
: Return the parent directories from the root folder.ee.Asset.name
: Return the asset name.ee.Asset.st_size
: Return the byte size of the file.ee.Asset.type
: Return the asset type.ee.Asset.owner
: Return the asset owner (project name).