@google/earthengine 0.1.310 → 0.1.315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@google/earthengine",
3
- "version": "0.1.310",
3
+ "version": "0.1.315",
4
4
  "description": "JavaScript client for Google Earth Engine API.",
5
5
  "author": "Google LLC",
6
6
  "license": "Apache-2.0",
package/src/apiclient.js CHANGED
@@ -25,7 +25,7 @@ const {PromiseRequestService} = goog.require('eeapiclient.promise_request_servic
25
25
  /** @namespace */
26
26
  const apiclient = {};
27
27
 
28
- const API_CLIENT_VERSION = '0.1.310';
28
+ const API_CLIENT_VERSION = '0.1.315';
29
29
 
30
30
  exports.VERSION = apiVersion.VERSION;
31
31
  exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
@@ -195,6 +195,7 @@ ee.ComputedObject.prototype.serialize = function(legacy = false) {
195
195
 
196
196
  /**
197
197
  * @return {string} A human-readable representation of the object.
198
+ * @override
198
199
  */
199
200
  ee.ComputedObject.prototype.toString = function() {
200
201
  return 'ee.' + this.name() + '(' + ee.Serializer.toReadableJSON(this) + ')';
package/src/data.js CHANGED
@@ -70,6 +70,7 @@ goog.require('ee.rpc_convert_batch');
70
70
  goog.require('goog.array');
71
71
  goog.require('goog.functions');
72
72
  goog.require('goog.object');
73
+ goog.require('goog.singleton');
73
74
  goog.requireType('ee.Collection');
74
75
  goog.requireType('ee.ComputedObject');
75
76
  goog.requireType('ee.Element');
@@ -551,11 +552,11 @@ ee.data.listFeatures = function(asset, params, opt_callback) {
551
552
  ee.data.computeValue = function(obj, opt_callback) {
552
553
  const expression =
553
554
  ee.data.expressionAugmenter_(ee.Serializer.encodeCloudApiExpression(obj));
555
+ const request = {expression};
554
556
  const call = new ee.apiclient.Call(opt_callback);
555
557
  return call.handle(
556
558
  call.value()
557
- .compute(
558
- call.projectsPath(), new ee.api.ComputeValueRequest({expression}))
559
+ .compute(call.projectsPath(), new ee.api.ComputeValueRequest(request))
559
560
  .then(x => x['result']));
560
561
  };
561
562
 
@@ -1881,7 +1882,6 @@ ee.data.getAssetRootQuota = function(rootId, opt_callback) {
1881
1882
  return call.handle(getAssetRequest.then(getResponse));
1882
1883
  };
1883
1884
 
1884
-
1885
1885
  ////////////////////////////////////////////////////////////////////////////////
1886
1886
  // Types and enums. //
1887
1887
  ////////////////////////////////////////////////////////////////////////////////
@@ -2965,7 +2965,8 @@ ee.data.MapZoomRange = {
2965
2965
  * type: string,
2966
2966
  * description: (undefined|string),
2967
2967
  * sourceUrl: (undefined|string),
2968
- * element: (undefined|!ee.Element|!ee.ComputedObject)
2968
+ * element: (undefined|!ee.Element|!ee.ComputedObject),
2969
+ * workloadTag: (undefined|string),
2969
2970
  * }}
2970
2971
  */
2971
2972
  ee.data.AbstractTaskConfig;
@@ -2996,7 +2997,8 @@ ee.data.AbstractTaskConfig;
2996
2997
  * outputBucket: (undefined|string),
2997
2998
  * outputPrefix: (undefined|string),
2998
2999
  * assetId: (undefined|string),
2999
- * pyramidingPolicy: (undefined|string)
3000
+ * pyramidingPolicy: (undefined|string),
3001
+ * workloadTag: (undefined|string),
3000
3002
  * }}
3001
3003
  */
3002
3004
  ee.data.ImageTaskConfigUnformatted;
@@ -3039,7 +3041,8 @@ ee.data.ImageTaskConfigUnformatted;
3039
3041
  * outputBucket: (undefined|string),
3040
3042
  * outputPrefix: (undefined|string),
3041
3043
  * assetId: (undefined|string),
3042
- * pyramidingPolicy: (undefined|string)
3044
+ * pyramidingPolicy: (undefined|string),
3045
+ * workloadTag: (undefined|string),
3043
3046
  * }}
3044
3047
  */
3045
3048
  ee.data.ImageTaskConfig;
@@ -3060,7 +3063,8 @@ ee.data.ImageTaskConfig;
3060
3063
  * sequenceData: (undefined|boolean),
3061
3064
  * collapseBands: (undefined|boolean),
3062
3065
  * maskedThreshold: (undefined|number),
3063
- * shardSize: (undefined|number)
3066
+ * shardSize: (undefined|number),
3067
+ * workloadTag: (undefined|string),
3064
3068
  * }}
3065
3069
  */
3066
3070
  ee.data.ImageExportFormatConfig;
@@ -3088,7 +3092,8 @@ ee.data.ImageExportFormatConfig;
3088
3092
  * outputPrefix: (undefined|string),
3089
3093
  * bucketCorsUris: (undefined|!Array<string>),
3090
3094
  * mapsApiKey: (undefined|string),
3091
- * generateEarthHtml: (undefined|boolean)
3095
+ * generateEarthHtml: (undefined|boolean),
3096
+ * workloadTag: (undefined|string),
3092
3097
  * }}
3093
3098
  */
3094
3099
  ee.data.MapTaskConfig;
@@ -3108,6 +3113,7 @@ ee.data.MapTaskConfig;
3108
3113
  * thinningStrategy: (undefined|!ee.data.ThinningStrategy),
3109
3114
  * thinningRanking: (undefined|string|!Array<string>),
3110
3115
  * zOrderRanking: (undefined|string|!Array<string>),
3116
+ * workloadTag: (undefined|string),
3111
3117
  * }}
3112
3118
  */
3113
3119
  ee.data.FeatureViewTaskConfig;
@@ -3130,7 +3136,8 @@ ee.data.FeatureViewTaskConfig;
3130
3136
  * outputPrefix: (undefined|string),
3131
3137
  * assetId: (undefined|string),
3132
3138
  * maxWorkers: (undefined|number),
3133
- * maxVertices: (undefined|number)
3139
+ * maxVertices: (undefined|number),
3140
+ * workloadTag: (undefined|string),
3134
3141
  * }}
3135
3142
  */
3136
3143
  ee.data.TableTaskConfig;
@@ -3157,7 +3164,8 @@ ee.data.TableTaskConfig;
3157
3164
  * driveFolder: (undefined|string),
3158
3165
  * driveFileNamePrefix: (undefined|string),
3159
3166
  * outputBucket: (undefined|string),
3160
- * outputPrefix: (undefined|string)
3167
+ * outputPrefix: (undefined|string),
3168
+ * workloadTag: (undefined|string),
3161
3169
  * }}
3162
3170
  */
3163
3171
  ee.data.VideoTaskConfig;
package/src/ee.js CHANGED
@@ -51,10 +51,12 @@ goog.require('goog.object');
51
51
  * In most cases, an authorization token should be set before the library
52
52
  * is initialized, either with ee.data.authorize() or ee.data.setAuthToken().
53
53
  *
54
- * Note that some parameters differ between JavaScript and Python. In
55
- * addition to opt_url and project below, Python also supports: credentials -
56
- * a google.oauth2.Credentials object or 'persistent' to use stored
57
- * credentials (the default); http_transport - a httplib2.Http client.
54
+ * In Python, this method is named ee.Initialize, with a capital I. Note that
55
+ * some parameters differ between JavaScript and Python. In addition to opt_url
56
+ * and project below, Python also supports:
57
+ * credentials - a google.oauth2.Credentials object or 'persistent' to use
58
+ * stored credentials (the default);
59
+ * http_transport - a httplib2.Http client.
58
60
  *
59
61
  * @param {string?=} opt_baseurl The Earth Engine REST API endpoint.
60
62
  * (Python argument name: opt_url)
@@ -67,8 +69,8 @@ goog.require('goog.object');
67
69
  * invoked with an error if the initialization fails. (JavaScript only)
68
70
  * @param {string?=} opt_xsrfToken A string to pass in the "xsrfToken"
69
71
  * parameter of EE API XHRs. (JavaScript only)
70
- * @param {string?=} opt_project Optional project ID or number to use when
71
- making API calls. (Python argument name: project)
72
+ * @param {string?=} opt_project Optional client project ID or number to use
73
+ * when making API calls. (Python argument name: project)
72
74
  * @export
73
75
  */
74
76
  ee.initialize = function(
@@ -669,6 +671,10 @@ ee.makeClass_ = function(name) {
669
671
  }
670
672
  };
671
673
  goog.inherits(target, ee.ComputedObject);
674
+ /**
675
+ * @return {string}
676
+ * @override
677
+ */
672
678
  target.prototype.name = function() { return name; };
673
679
  ee.ApiFunction.importApi(target, name, name);
674
680
  return target;
@@ -24,12 +24,12 @@ type Primitive = string|number|boolean|null|undefined;
24
24
  * i.e., {a: {b: {c: boolean}}} gets transformed into {a?: {b?: {c?: boolean}}}
25
25
  */
26
26
  export type DeepPartialISerializable<T> =
27
- T extends Primitive ? Partial<T>: T extends object ?
27
+ T extends Primitive ? Partial<T>: T extends ISerializable ?
28
28
  Omit<
29
29
  {[K in keyof T]?: DeepPartialISerializable<T[K]>},
30
- 'Serializable$get'|'Serializable$has'|'Serializable$set'|
31
- 'getClassMetadata'|'getConstructor'|'getPartialClassMetadata'>:
32
- unknown;
30
+ keyof ISerializable|'getPartialClassMetadata'>:
31
+ T extends object ? {[K in keyof T]?: DeepPartialISerializable<T[K]>} :
32
+ unknown;
33
33
 
34
34
  /**
35
35
  * Description of the properties in a Serializable class.
@@ -113,6 +113,7 @@ ee.rpc_convert_batch.taskToExportTableRequest = function(params) {
113
113
  default:
114
114
  throw new Error(`Export destination "${destination}" unknown`);
115
115
  }
116
+
116
117
  return result;
117
118
  };
118
119
 
@@ -763,10 +764,10 @@ ee.rpc_convert_batch.buildRankByOneThingRule_ = function(ruleString) {
763
764
 
764
765
  // Parse rule string. Input is expected in the string format: `attr_name ASC,
765
766
  // .minZoomLevel DESC, .geometryType ASC` or as a list of strings: ["attr_name
766
- // ASC", ".pixelSize DESC", ".geometryType ASC"]. .minZoomLevel and .geometryType
767
- // correspond to minVisibleLOD and geometryType ranking rules in DMS. Rules
768
- // that do not start with the keywords ".minZoomLevel" or ".geometryType" are
769
- // assumed to be attribute rules.
767
+ // ASC", ".pixelSize DESC", ".geometryType ASC"]. .minZoomLevel and
768
+ // .geometryType correspond to minVisibleLOD and geometryType ranking rules in
769
+ // DMS. Rules that do not start with the keywords ".minZoomLevel" or
770
+ // ".geometryType" are assumed to be attribute rules.
770
771
  ruleString = ruleString.trim();
771
772
  const matches = ruleString.match(/^([\S]+.*)\s+(ASC|DESC)$/);
772
773
  if (matches == null) {
package/src/feature.js CHANGED
@@ -122,6 +122,7 @@ ee.Feature.reset = function() {
122
122
  * the second if unsuccessful.
123
123
  * @return {ee.data.GeoJSONFeature} A description of the feature.
124
124
  * @export
125
+ * @override
125
126
  */
126
127
  ee.Feature.prototype.getInfo = function(opt_callback) {
127
128
  return /** @type {ee.data.GeoJSONFeature} */(
@@ -179,6 +179,7 @@ ee.FeatureCollection.prototype.getMap = function(opt_visParams, opt_callback) {
179
179
  * - properties: an optional dictionary containing the collection's
180
180
  * metadata properties.
181
181
  * @export
182
+ * @override
182
183
  */
183
184
  ee.FeatureCollection.prototype.getInfo = function(opt_callback) {
184
185
  return /** @type {ee.data.FeatureCollectionDescription} */(
package/src/geometry.js CHANGED
@@ -660,6 +660,7 @@ goog.inherits(ee.Geometry.MultiPolygon, ee.Geometry);
660
660
  * @param {function(*): *=} opt_encoder A function that can be called to encode
661
661
  * the components of an object.
662
662
  * @return {*} An encoded representation of the geometry.
663
+ * @override
663
664
  */
664
665
  ee.Geometry.prototype.encode = function(opt_encoder) {
665
666
  if (!this.type_) {
package/src/image.js CHANGED
@@ -143,6 +143,7 @@ ee.Image.reset = function() {
143
143
  * - bands - a list containing metadata about the bands in the collection.
144
144
  * - properties - a dictionary containing the image's metadata properties.
145
145
  * @export
146
+ * @override
146
147
  */
147
148
  ee.Image.prototype.getInfo = function(opt_callback) {
148
149
  return /** @type {ee.data.ImageDescription} */(
@@ -298,6 +298,7 @@ ee.ImageCollection.prototype.getMap = function(opt_visParams, opt_callback) {
298
298
  * - properties: an optional dictionary containing the collection's
299
299
  * metadata properties.
300
300
  * @export
301
+ * @override
301
302
  */
302
303
  ee.ImageCollection.prototype.getInfo = function(opt_callback) {
303
304
  return /** @type {!ee.data.ImageCollectionDescription} */(
@@ -101,6 +101,7 @@ ee.MapLayerOverlay = class extends ee.AbstractOverlay {
101
101
  * @param {number} zoom Zoom level.
102
102
  * @param {Node} ownerDocument Parent document.
103
103
  * @return {Node} Element to be displayed as a map tile.
104
+ * @override
104
105
  */
105
106
  getTile(coord, zoom, ownerDocument) {
106
107
  var maxCoord = 1 << zoom;
@@ -153,7 +154,10 @@ ee.MapLayerOverlay = class extends ee.AbstractOverlay {
153
154
  return this.tiles_.getCount();
154
155
  }
155
156
 
156
- /** @return {number} The number of tiles currently loading. */
157
+ /**
158
+ * @return {number} The number of tiles currently loading.
159
+ * @override
160
+ */
157
161
  getLoadingTilesCount() {
158
162
  return this.tilesLoading.length;
159
163
  }