Skip to content

Commit

Permalink
v0.1.390
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 605669271
  • Loading branch information
Google Earth Engine Authors authored and jgarcia525 committed Feb 14, 2024
1 parent b5cde4e commit 15eba7a
Show file tree
Hide file tree
Showing 21 changed files with 611 additions and 246 deletions.
32 changes: 16 additions & 16 deletions javascript/build/ee_api_js.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions javascript/build/ee_api_js_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -18593,7 +18593,7 @@ var $jscomp$templatelit$294235699$96 = $jscomp.createTemplateTagFirstArg(["https
ee.apiclient = {};
var module$contents$ee$apiclient_apiclient = {};
ee.apiclient.VERSION = module$exports$ee$apiVersion.V1;
ee.apiclient.API_CLIENT_VERSION = "0.1.389";
ee.apiclient.API_CLIENT_VERSION = "0.1.390";
ee.apiclient.NULL_VALUE = module$exports$eeapiclient$domain_object.NULL_VALUE;
ee.apiclient.PromiseRequestService = module$exports$eeapiclient$promise_request_service.PromiseRequestService;
ee.apiclient.MakeRequestParams = module$contents$eeapiclient$request_params_MakeRequestParams;
Expand Down Expand Up @@ -18883,8 +18883,8 @@ module$contents$ee$apiclient_apiclient.send = function(path, params, callback, m
var profileHookAtCallTime = module$contents$ee$apiclient_apiclient.profileHook_, contentType = "application/x-www-form-urlencoded";
body && (contentType = "application/json", method && method.startsWith("multipart") && (contentType = method, method = "POST"));
method = method || "POST";
var headers = {"Content-Type":contentType}, version = "0.1.389";
"0.1.389" === version && (version = "latest");
var headers = {"Content-Type":contentType}, version = "0.1.390";
"0.1.390" === version && (version = "latest");
headers[module$contents$ee$apiclient_apiclient.API_CLIENT_VERSION_HEADER] = "ee-js/" + version;
var authToken = module$contents$ee$apiclient_apiclient.getAuthToken();
if (null != authToken) {
Expand Down
51 changes: 26 additions & 25 deletions javascript/build/ee_api_js_npm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@google/earthengine",
"version": "0.1.389",
"version": "0.1.390",
"description": "JavaScript client for Google Earth Engine API.",
"author": "Google LLC",
"license": "Apache-2.0",
Expand Down
2 changes: 1 addition & 1 deletion javascript/src/apiclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const {trustedResourceUrl} = goog.require('safevalues');
/** @namespace */
const apiclient = {};

const API_CLIENT_VERSION = '0.1.389';
const API_CLIENT_VERSION = '0.1.390';

exports.VERSION = apiVersion.VERSION;
exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
Expand Down
4 changes: 2 additions & 2 deletions javascript/src/batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ Export.videoMap.prepareTaskConfig_ = function(taskConfig, destination) {
* Adapts a ServerTaskConfig into a ClassifierTaskConfig normalizing any params
* for a classifier task.
*
* @param {!ServerTaskConfig} taskConfig VideoMap export config to
* @param {!ServerTaskConfig} taskConfig Classifier export config to
* prepare.
* @param {!data.ExportDestination} destination Export destination.
* @return {!data.ClassifierTaskConfig}
Expand Down Expand Up @@ -964,7 +964,7 @@ Export.reconcileMapFormat = function(taskConfig) {
* @return {!ServerTaskConfig}
*/
Export.reconcileTableFormat = function(taskConfig) {
// Parse the image file format from the given task config.
// Parse the table file format from the given task config.
let formatString = taskConfig['fileFormat'];
// If not specified assume the format is CSV.
if (formatString == null) {
Expand Down
346 changes: 245 additions & 101 deletions javascript/src/data.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions javascript/src/eeapiclient/domain_object.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/**
* g3-format-changed-lines-during-prettier-version-upgrade
* Utility map for ClassMetadata to describe how to create instances of child
* properties.
*/
Expand Down
1 change: 1 addition & 0 deletions javascript/src/eeapiclient/multipart_request.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// g3-format-changed-lines-during-prettier-version-upgrade
import {Serializable, serialize} from './domain_object';

export class MultipartRequest {
Expand Down
165 changes: 106 additions & 59 deletions javascript/src/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,42 +217,74 @@ ee.Image.prototype.getMap = ee.Image.prototype.getMapId;
* Use getThumbURL for RGB visualization formats PNG and JPG.
* @param {Object} params An object containing download options with the
* following possible values:
* - name: a base name to use when constructing filenames. Only applicable
* when format is "ZIPPED_GEO_TIFF" (default) or filePerBand is true.
* Defaults to the image id (or "download" for computed images) when
* format is "ZIPPED_GEO_TIFF" or filePerBand is true, otherwise a
* random character string is generated. Band names are appended when
* filePerBand is true.
* - bands: a description of the bands to download. Must be an array of band
* names or an array of dictionaries, each with the following keys
* (optional parameters apply only when filePerBand is true):
* + id: the name of the band, a string, required.
* + crs: an optional CRS string defining the band projection.
* + crs_transform: an optional array of 6 numbers specifying an affine
* transform from the specified CRS, in row-major order:
* [xScale, xShearing, xTranslation, yShearing, yScale, yTranslation]
* + dimensions: an optional array of two integers defining the width and
* height to which the band is cropped.
* + scale: an optional number, specifying the scale in meters of the band;
* ignored if crs and crs_transform are specified.
* - crs: a default CRS string to use for any bands that do not explicitly
* specify one.
* - crs_transform: a default affine transform to use for any bands that do
* not specify one, of the same format as the crs_transform of bands.
* - dimensions: default image cropping dimensions to use for any bands that
* do not specify them.
* - scale: a default scale to use for any bands that do not specify one;
* ignored if crs and crs_transform are specified.
* - region: a polygon specifying a region to download; ignored if crs
* and crs_transform is specified.
* - filePerBand: whether to produce a separate GeoTIFF per band (boolean).
* Defaults to true. If false, a single GeoTIFF is produced and all
* band-level transformations will be ignored.
* - format: the download format. One of: "ZIPPED_GEO_TIFF" (GeoTIFF file(s)
* wrapped in a zip file, default), "GEO_TIFF" (GeoTIFF file),
* "NPY" (NumPy binary format). If "GEO_TIFF" or "NPY", filePerBand
* and all band-level transformations will be ignored. Loading a NumPy
* output results in a structured array.
* <table>
* <tr>
* <td><code> name: </code> a base name to use when constructing
* filenames. Only applicable when format is "ZIPPED_GEO_TIFF" (default)
* or filePerBand is true. Defaults to the image id (or "download" for
* computed images) when format is "ZIPPED_GEO_TIFF" or filePerBand is
* true, otherwise a random character string is generated. Band names
* are appended when filePerBand is true.</td>
* </tr>
* <tr>
* <td><code> bands: </code> a description of the bands to download. Must
* be an array of band names or an array of dictionaries, each with the
* following keys (optional parameters apply only when filePerBand is
* true):<ul style="list-style-type:none;">
* <li><code> id: </code> the name of the band, a string, required.
* <li><code> crs: </code> an optional CRS string defining the
* band projection.</li>
* <li><code> crs_transform: </code> an optional array of 6 numbers
* specifying an affine transform from the specified CRS, in
* row-major order: [xScale, xShearing, xTranslation, yShearing,
* yScale, yTranslation]</li>
* <li><code> dimensions: </code> an optional array of two integers
* defining the width and height to which the band is cropped.</li>
* <li><code> scale: </code> an optional number, specifying the scale
* in meters of the band; ignored if crs and crs_transform are
* specified.</li></ul></td>
* </tr>
* <tr>
* <td><code> crs: </code> a default CRS string to use for any bands that
* do not explicitly specify one.</td>
* </tr>
* <tr>
* <td><code> crs_transform: </code> a default affine transform to use for
* any bands that do not specify one, of the same format as the
* <code>crs_transform</code> of bands.</td>
* </tr>
* <tr>
* <td><code> dimensions: </code> default image cropping dimensions to use
* for any bands that do not specify them.</td>
* </tr>
* <tr>
* <td><code> scale: </code> a default scale to use for any bands that do
* not specify one; ignored if <code>crs</code> and
* <code>crs_transform</code> are specified.</td>
* </tr>
* <tr>
* <td><code> region: </code> a polygon specifying a region to download;
* ignored if <code>crs</code> and <code>crs_transform</code> is
* specified.</td>
* </tr>
* <tr>
* <td><code> filePerBand: </code> whether to produce a separate GeoTIFF
* per band (boolean). Defaults to true. If false, a single GeoTIFF is
* produced and all band-level transformations will be ignored.</td>
* </tr>
* <tr>
* <td><code> format: </code> the download format. One of:
* <ul style="list-style-type:none;">
* <li> "ZIPPED_GEO_TIFF" (GeoTIFF file(s) wrapped in a zip file,
* default)</li>
* <li> "GEO_TIFF" (GeoTIFF file)</li>
* <li> "NPY" (NumPy binary format)</li>
* </ul>
* If "GEO_TIFF" or "NPY", filePerBand and all band-level transformations
* will be ignored. Loading a NumPy output results in a structured
* array.</td>
* </tr>
* </table>
* @param {function(string?, string=)=} opt_callback An optional
* callback. If not supplied, the call is made synchronously.
* @return {string|undefined} Returns a download URL, or undefined if a callback
Expand Down Expand Up @@ -284,13 +316,19 @@ ee.Image.prototype.getDownloadURL = function(params, opt_callback) {
* Applies transformations and returns the thumbId.
* @param {!Object} params Parameters identical to ee.data.getMapId, plus,
* optionally:
* - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
* dimensions of the thumbnail to render, in pixels. If only one
* number is passed, it is used as the maximum, and the other
* dimension is computed by proportional scaling.
* - region Geospatial region of the image to render, it may be an ee.Geometry,
* GeoJSON, or an array of lat/lon points (E,S,W,N). If not set the
* default is the bounds image.
* <table>
* <tr>
* <td><code> dimensions </code> (a number or pair of numbers in format
* WIDTHxHEIGHT) Maximum dimensions of the thumbnail to render, in
* pixels. If only one number is passed, it is used as the maximum,
* and the other dimension is computed by proportional scaling.</td>
* </tr>
* <tr>
* <td><code> region </code> Geospatial region of the image to render,
* it may be an ee.Geometry, GeoJSON, or an array of lat/lon
* points (E,S,W,N). If not set the default is the bounds image.</td>
* </tr>
* </table>
* @param {function(?ee.data.ThumbnailId, string=)=} opt_callback
* An optional callback. If not supplied, the call is made synchronously.
* @return {?ee.data.ThumbnailId} The thumb ID and optional token, or null if a
Expand Down Expand Up @@ -318,14 +356,22 @@ ee.Image.prototype.getThumbId = function(params, opt_callback) {
* Get a thumbnail URL for this image.
* @param {!Object} params Parameters identical to ee.data.getMapId, plus,
* optionally:
* - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
* dimensions of the thumbnail to render, in pixels. If only one
* number is passed, it is used as the maximum, and the other
* dimension is computed by proportional scaling.
* - region Geospatial region of the image to render, it may be an ee.Geometry,
* GeoJSON, or an array of lat/lon points (E,S,W,N). If not set the
* default is the bounds image.
* - format (string) Either 'png' or 'jpg'.
* <table>
* <tr>
* <td><code> dimensions </code> (a number or pair of numbers in format
* WIDTHxHEIGHT) Maximum dimensions of the thumbnail to render, in
* pixels. If only one number is passed, it is used as the maximum,
* and the other dimension is computed by proportional scaling.</td>
* </tr>
* <tr>
* <td><code> region </code> Geospatial region of the image to render,
* it may be an ee.Geometry, GeoJSON, or an array of lat/lon
* points (E,S,W,N). If not set the default is the bounds image.</td>
* </tr>
* <tr>
* <td><code> format </code> (string) Either 'png' or 'jpg'.</td>
* </tr>
* </table>
* @param {function(string, string=)=} opt_callback An optional
* callback. If not supplied, the call is made synchronously.
* @return {string|undefined} A thumbnail URL, or undefined if a callback
Expand Down Expand Up @@ -433,14 +479,15 @@ ee.Image.combine_ = function(images, opt_names) {
* Selects bands from an image.
*
* @param {...*} var_args One of two possibilities:
* - Any number of non-list arguments. All of these will be interpreted as band
* selectors. These can be band names, regexes, or numeric indices. E.g.
* selected = image.select('a', 'b', 3, 'd');
* - Two lists. The first will be used as band selectors and the second
* as new names for the selected bands. The number of new names must match
* the number of selected bands. E.g.
* selected = image.select(['a', 4], ['newA', 'newB']);
*
* <ul>
* <li> Any number of non-list arguments. All of these will be interpreted as
* band selectors. These can be band names, regexes, or numeric indices.
* E.g. selected = image.select('a', 'b', 3, 'd');</li>
* <li> Two lists. The first will be used as band selectors and the second
* as new names for the selected bands. The number of new names must match
* the number of selected bands. E.g.
* selected = image.select(['a', 4], ['newA', 'newB']);</li>
* </ul>
* @return {!ee.Image} An image with the selected bands.
* @export
*/
Expand Down
51 changes: 36 additions & 15 deletions javascript/src/imagecollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,23 @@ ee.ImageCollection.reset = function() {
* Get the URL of a tiled thumbnail for this ImageCollection.
* @param {!Object} params Parameters identical to ee.data.getMapId, plus,
* optionally:
* - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
* dimensions of each thumbnail frame to render, in pixels. If only one
* number is passed, it is used as the maximum, and the other
* dimension is computed by proportional scaling.
* - region (E,S,W,N or GeoJSON) Geospatial region of the image
* to render. By default, the whole image.
* - format (string) Encoding format. Only 'png' or 'jpg' are accepted.
* <table>
* <tr>
* <td><code> dimensions </code> (a number or pair of numbers in
* format WIDTHxHEIGHT) Maximum dimensions of each thumbnail frame to
* render, in pixels. If only one number is passed, it is used as the
* maximum, and the other dimension is computed by proportional
* scaling.</td>
* </tr>
* <tr>
* <td><code> region </code> (E,S,W,N or GeoJSON) Geospatial region of
* the image to render. By default, the whole image.</td>
* </tr>
* <tr>
* <td><code> format </code> (string) Encoding format. Only 'png'
* or 'jpg' are accepted.</td>
* </tr>
* </table>
* @param {function(string, string=)=} opt_callback An optional
* callback which handles the resulting URL string. If not supplied, the
* call is made synchronously.
Expand All @@ -141,14 +151,25 @@ ee.ImageCollection.prototype.getFilmstripThumbURL = function(params, opt_callbac
* Get the URL of an animated thumbnail for this ImageCollection.
* @param {!Object} params Parameters identical to ee.data.getMapId, plus,
* optionally:
* - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
* dimensions of the thumbnail to render, in pixels. If only one
* number is passed, it is used as the maximum, and the other
* dimension is computed by proportional scaling.
* - region (E,S,W,N or GeoJSON) Geospatial region of the image
* to render. By default, the whole image.
* - format (string) Encoding format. Only 'gif' is accepted.
* - framesPerSecond (number) Animation speed.
* <table>
* <tr>
* <td><code> dimensions </code> (a number or pair of numbers in format
* WIDTHxHEIGHT) Maximum dimensions of the thumbnail to render, in
* pixels. If only one number is passed, it is used as the maximum, and
* the other dimension is computed by proportional scaling.</td>
* </tr>
* <tr>
* <td><code> region </code> (E,S,W,N or GeoJSON) Geospatial region of
* the image to render. By default, the whole image.</td>
* </tr>
* <tr>
* <td><code> format </code> (string) Encoding format. Only 'gif'
* is accepted.</td>
* </tr>
* <tr>
* <td><code> framesPerSecond </code> (number) Animation speed.</td>
* </tr>
* </table>
* @param {function(string, string=)=} opt_callback An optional
* callback which handles the resulting URL string. If not supplied, the
* call is made synchronously.
Expand Down
2 changes: 1 addition & 1 deletion python/ee/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""The EE Python library."""

__version__ = '0.1.389'
__version__ = '0.1.390'

# Using lowercase function naming to match the JavaScript names.
# pylint: disable=g-bad-name
Expand Down
35 changes: 26 additions & 9 deletions python/ee/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,11 +859,19 @@ def __new__(cls, collection, description='myExportVideoTask', config=None):
# Disable argument usage check; arguments are accessed using locals().
# pylint: disable=unused-argument
@staticmethod
def toCloudStorage(collection, description='myExportVideoTask',
bucket=None, fileNamePrefix=None, framesPerSecond=None,
dimensions=None, region=None, scale=None, crs=None,
crsTransform=None, maxPixels=None,
maxFrames=None, **kwargs):
def toCloudStorage(collection,
description='myExportVideoTask',
bucket=None,
fileNamePrefix=None,
framesPerSecond=None,
dimensions=None,
region=None,
scale=None,
crs=None,
crsTransform=None,
maxPixels=None,
maxFrames=None,
**kwargs):
"""Creates a task to export an ImageCollection video to Cloud Storage.
Args:
Expand Down Expand Up @@ -909,10 +917,19 @@ def toCloudStorage(collection, description='myExportVideoTask',
return _create_export_task(config, Task.Type.EXPORT_VIDEO)

@staticmethod
def toDrive(collection, description='myExportVideoTask',
folder=None, fileNamePrefix=None, framesPerSecond=None,
dimensions=None, region=None, scale=None, crs=None,
crsTransform=None, maxPixels=None, maxFrames=None, **kwargs):
def toDrive(collection,
description='myExportVideoTask',
folder=None,
fileNamePrefix=None,
framesPerSecond=None,
dimensions=None,
region=None,
scale=None,
crs=None,
crsTransform=None,
maxPixels=None,
maxFrames=None,
**kwargs):
"""Creates a task to export an ImageCollection as a video to Drive.
Args:
Expand Down
Loading

0 comments on commit 15eba7a

Please sign in to comment.