@google/earthengine 1.4.6 → 1.5.0

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": "1.4.6",
3
+ "version": "1.5.0",
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
@@ -24,7 +24,7 @@ const {trustedResourceUrl} = goog.require('safevalues');
24
24
  /** @namespace */
25
25
  const apiclient = {};
26
26
 
27
- const API_CLIENT_VERSION = '1.4.6';
27
+ const API_CLIENT_VERSION = '1.5.0';
28
28
 
29
29
  exports.VERSION = apiVersion.VERSION;
30
30
  exports.API_CLIENT_VERSION = API_CLIENT_VERSION;
package/src/batch.js CHANGED
@@ -5,8 +5,6 @@ goog.module.declareLegacyNamespace();
5
5
 
6
6
  const ComputedObject = goog.require('ee.ComputedObject');
7
7
  const Element = goog.require('ee.Element');
8
- const ExportDestination = goog.require('ee.data.ExportDestination');
9
- const ExportType = goog.require('ee.data.ExportType');
10
8
  const FeatureCollection = goog.require('ee.FeatureCollection');
11
9
  const Geometry = goog.require('ee.Geometry');
12
10
  const GoogPromise = goog.require('goog.Promise');
@@ -137,7 +135,7 @@ Export.image.toAsset = function(
137
135
  const clientConfig =
138
136
  eeArguments.extractFromFunction(Export.image.toAsset, arguments);
139
137
  const serverConfig = Export.convertToServerParams(
140
- clientConfig, ExportDestination.ASSET, ExportType.IMAGE);
138
+ clientConfig, data.ExportDestination.ASSET, data.ExportType.IMAGE);
141
139
  return ExportTask.create(serverConfig);
142
140
  };
143
141
 
@@ -170,7 +168,7 @@ Export.image.toCloudStorage = function(
170
168
  const clientConfig =
171
169
  eeArguments.extractFromFunction(Export.image.toCloudStorage, arguments);
172
170
  const serverConfig = Export.convertToServerParams(
173
- clientConfig, ExportDestination.GCS, ExportType.IMAGE);
171
+ clientConfig, data.ExportDestination.GCS, data.ExportType.IMAGE);
174
172
  return ExportTask.create(serverConfig);
175
173
  };
176
174
 
@@ -203,7 +201,7 @@ Export.image.toDrive = function(
203
201
  const clientConfig =
204
202
  eeArguments.extractFromFunction(Export.image.toDrive, arguments);
205
203
  const serverConfig = Export.convertToServerParams(
206
- clientConfig, ExportDestination.DRIVE, ExportType.IMAGE);
204
+ clientConfig, data.ExportDestination.DRIVE, data.ExportType.IMAGE);
207
205
  return ExportTask.create(serverConfig);
208
206
  };
209
207
 
@@ -233,7 +231,7 @@ Export.map.toCloudStorage = function(
233
231
  const clientConfig =
234
232
  eeArguments.extractFromFunction(Export.map.toCloudStorage, arguments);
235
233
  const serverConfig = Export.convertToServerParams(
236
- clientConfig, ExportDestination.GCS, ExportType.MAP);
234
+ clientConfig, data.ExportDestination.GCS, data.ExportType.MAP);
237
235
  return ExportTask.create(serverConfig);
238
236
  };
239
237
 
@@ -256,7 +254,7 @@ Export.table.toCloudStorage = function(
256
254
  const clientConfig =
257
255
  eeArguments.extractFromFunction(Export.table.toCloudStorage, arguments);
258
256
  const serverConfig = Export.convertToServerParams(
259
- clientConfig, ExportDestination.GCS, ExportType.TABLE);
257
+ clientConfig, data.ExportDestination.GCS, data.ExportType.TABLE);
260
258
  return ExportTask.create(serverConfig);
261
259
  };
262
260
 
@@ -278,9 +276,9 @@ Export.table.toDrive = function(
278
276
  opt_selectors, opt_maxVertices, opt_priority) {
279
277
  const clientConfig =
280
278
  eeArguments.extractFromFunction(Export.table.toDrive, arguments);
281
- clientConfig['type'] = ExportType.TABLE;
279
+ clientConfig['type'] = data.ExportType.TABLE;
282
280
  const serverConfig = Export.convertToServerParams(
283
- clientConfig, ExportDestination.DRIVE, ExportType.TABLE);
281
+ clientConfig, data.ExportDestination.DRIVE, data.ExportType.TABLE);
284
282
  return ExportTask.create(serverConfig);
285
283
  };
286
284
 
@@ -299,7 +297,7 @@ Export.table.toAsset = function(
299
297
  const clientConfig =
300
298
  eeArguments.extractFromFunction(Export.table.toAsset, arguments);
301
299
  const serverConfig = Export.convertToServerParams(
302
- clientConfig, ExportDestination.ASSET, ExportType.TABLE);
300
+ clientConfig, data.ExportDestination.ASSET, data.ExportType.TABLE);
303
301
  return ExportTask.create(serverConfig);
304
302
  };
305
303
 
@@ -323,7 +321,7 @@ Export.table.toFeatureView = function(
323
321
  const clientConfig =
324
322
  eeArguments.extractFromFunction(Export.table.toFeatureView, arguments);
325
323
  const serverConfig = Export.convertToServerParams(
326
- clientConfig, ExportDestination.FEATURE_VIEW, ExportType.TABLE);
324
+ clientConfig, data.ExportDestination.FEATURE_VIEW, data.ExportType.TABLE);
327
325
  return ExportTask.create(serverConfig);
328
326
  };
329
327
 
@@ -346,7 +344,7 @@ Export.table.toBigQuery = function(
346
344
  const clientConfig =
347
345
  eeArguments.extractFromFunction(Export.table.toBigQuery, arguments);
348
346
  const serverConfig = Export.convertToServerParams(
349
- clientConfig, ExportDestination.BIGQUERY, ExportType.TABLE);
347
+ clientConfig, data.ExportDestination.BIGQUERY, data.ExportType.TABLE);
350
348
  return ExportTask.create(serverConfig);
351
349
  };
352
350
 
@@ -375,7 +373,7 @@ Export.video.toCloudStorage = function(
375
373
  const clientConfig =
376
374
  eeArguments.extractFromFunction(Export.video.toCloudStorage, arguments);
377
375
  const serverConfig = Export.convertToServerParams(
378
- clientConfig, ExportDestination.GCS, ExportType.VIDEO);
376
+ clientConfig, data.ExportDestination.GCS, data.ExportType.VIDEO);
379
377
  return ExportTask.create(serverConfig);
380
378
  };
381
379
 
@@ -404,7 +402,7 @@ Export.video.toDrive = function(
404
402
  const clientConfig =
405
403
  eeArguments.extractFromFunction(Export.video.toDrive, arguments);
406
404
  const serverConfig = Export.convertToServerParams(
407
- clientConfig, ExportDestination.DRIVE, ExportType.VIDEO);
405
+ clientConfig, data.ExportDestination.DRIVE, data.ExportType.VIDEO);
408
406
  return ExportTask.create(serverConfig);
409
407
  };
410
408
 
@@ -421,7 +419,7 @@ Export.classifier.toAsset = function(
421
419
  const clientConfig =
422
420
  eeArguments.extractFromFunction(Export.classifier.toAsset, arguments);
423
421
  const serverConfig = Export.convertToServerParams(
424
- clientConfig, ExportDestination.ASSET, ExportType.CLASSIFIER);
422
+ clientConfig, data.ExportDestination.ASSET, data.ExportType.CLASSIFIER);
425
423
  return ExportTask.create(serverConfig);
426
424
  };
427
425
 
@@ -507,7 +505,7 @@ Export.resolveRegionParam = function(params) {
507
505
  if (error) {
508
506
  reject(error);
509
507
  } else {
510
- if (params['type'] === ExportType.IMAGE) {
508
+ if (params['type'] === data.ExportType.IMAGE) {
511
509
  params['region'] = new Geometry(regionInfo);
512
510
  } else {
513
511
  params['region'] = Export.serializeRegion(regionInfo);
@@ -517,7 +515,7 @@ Export.resolveRegionParam = function(params) {
517
515
  });
518
516
  });
519
517
  }
520
- if (params['type'] === ExportType.IMAGE) {
518
+ if (params['type'] === data.ExportType.IMAGE) {
521
519
  params['region'] = new Geometry(region);
522
520
  } else {
523
521
  params['region'] = Export.serializeRegion(region);
@@ -580,22 +578,22 @@ Export.convertToServerParams = function(
580
578
  Object.assign(taskConfig, originalArgs);
581
579
 
582
580
  switch (exportType) {
583
- case ExportType.IMAGE:
581
+ case data.ExportType.IMAGE:
584
582
  taskConfig = Export.image.prepareTaskConfig_(taskConfig, destination);
585
583
  break;
586
- case ExportType.MAP:
584
+ case data.ExportType.MAP:
587
585
  taskConfig = Export.map.prepareTaskConfig_(taskConfig, destination);
588
586
  break;
589
- case ExportType.TABLE:
587
+ case data.ExportType.TABLE:
590
588
  taskConfig = Export.table.prepareTaskConfig_(taskConfig, destination);
591
589
  break;
592
- case ExportType.VIDEO:
590
+ case data.ExportType.VIDEO:
593
591
  taskConfig = Export.video.prepareTaskConfig_(taskConfig, destination);
594
592
  break;
595
- case ExportType.VIDEO_MAP:
593
+ case data.ExportType.VIDEO_MAP:
596
594
  taskConfig = Export.videoMap.prepareTaskConfig_(taskConfig, destination);
597
595
  break;
598
- case ExportType.CLASSIFIER:
596
+ case data.ExportType.CLASSIFIER:
599
597
  taskConfig =
600
598
  Export.classifier.prepareTaskConfig_(taskConfig, destination);
601
599
  break;
@@ -620,7 +618,7 @@ Export.convertToServerParams = function(
620
618
  Export.prepareDestination_ = function(taskConfig, destination) {
621
619
  // Convert to deprecated backend keys or fill with empty strings.
622
620
  switch (destination) {
623
- case ExportDestination.GCS:
621
+ case data.ExportDestination.GCS:
624
622
  taskConfig['outputBucket'] = taskConfig['bucket'] || '';
625
623
  taskConfig['outputPrefix'] =
626
624
  (taskConfig['fileNamePrefix'] || taskConfig['path'] || '');
@@ -628,17 +626,17 @@ Export.prepareDestination_ = function(taskConfig, destination) {
628
626
  delete taskConfig['path'];
629
627
  delete taskConfig['bucket'];
630
628
  break;
631
- case ExportDestination.ASSET:
629
+ case data.ExportDestination.ASSET:
632
630
  taskConfig['assetId'] = taskConfig['assetId'] || '';
633
631
  break;
634
- case ExportDestination.FEATURE_VIEW:
632
+ case data.ExportDestination.FEATURE_VIEW:
635
633
  taskConfig['mapName'] = taskConfig['mapName'] || '';
636
634
  break;
637
- case ExportDestination.BIGQUERY:
635
+ case data.ExportDestination.BIGQUERY:
638
636
  taskConfig['table'] = taskConfig['table'] || '';
639
637
  break;
640
638
  // The default is to drive.
641
- case ExportDestination.DRIVE:
639
+ case data.ExportDestination.DRIVE:
642
640
  default:
643
641
  // Catch legacy function signature for toDrive calls.
644
642
  const allowedFolderType = ['string', 'undefined'];
package/src/data.js CHANGED
@@ -6,9 +6,6 @@
6
6
  */
7
7
 
8
8
  goog.provide('ee.data');
9
- goog.provide('ee.data.AssetType');
10
- goog.provide('ee.data.ExportDestination');
11
- goog.provide('ee.data.ExportType');
12
9
  goog.provide('ee.data.FeatureCollectionDescription');
13
10
  goog.provide('ee.data.ImageCollectionDescription');
14
11
  goog.provide('ee.data.ImageDescription');
package/src/ee.js CHANGED
@@ -3,8 +3,6 @@
3
3
  */
4
4
 
5
5
  goog.provide('ee');
6
- goog.provide('ee.Algorithms');
7
- goog.provide('ee.InitState');
8
6
 
9
7
  goog.require('ee.ApiFunction');
10
8
  goog.require('ee.Collection');