@google/earthengine 0.1.389 → 0.1.391

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.
@@ -5,7 +5,10 @@ export class MultipartRequest {
5
5
  private _metadataPayload = '';
6
6
  private _payloadPromise: Promise<string>;
7
7
 
8
- constructor(private files: File[], private _metadata?: {} | null) {
8
+ constructor(
9
+ private files: File[],
10
+ private _metadata?: {} | null,
11
+ ) {
9
12
  this._boundary = Date.now().toString();
10
13
  if (_metadata) {
11
14
  this.addMetadata(_metadata);
package/src/image.js CHANGED
@@ -217,42 +217,74 @@ ee.Image.prototype.getMap = ee.Image.prototype.getMapId;
217
217
  * Use getThumbURL for RGB visualization formats PNG and JPG.
218
218
  * @param {Object} params An object containing download options with the
219
219
  * following possible values:
220
- * - name: a base name to use when constructing filenames. Only applicable
221
- * when format is "ZIPPED_GEO_TIFF" (default) or filePerBand is true.
222
- * Defaults to the image id (or "download" for computed images) when
223
- * format is "ZIPPED_GEO_TIFF" or filePerBand is true, otherwise a
224
- * random character string is generated. Band names are appended when
225
- * filePerBand is true.
226
- * - bands: a description of the bands to download. Must be an array of band
227
- * names or an array of dictionaries, each with the following keys
228
- * (optional parameters apply only when filePerBand is true):
229
- * + id: the name of the band, a string, required.
230
- * + crs: an optional CRS string defining the band projection.
231
- * + crs_transform: an optional array of 6 numbers specifying an affine
232
- * transform from the specified CRS, in row-major order:
233
- * [xScale, xShearing, xTranslation, yShearing, yScale, yTranslation]
234
- * + dimensions: an optional array of two integers defining the width and
235
- * height to which the band is cropped.
236
- * + scale: an optional number, specifying the scale in meters of the band;
237
- * ignored if crs and crs_transform are specified.
238
- * - crs: a default CRS string to use for any bands that do not explicitly
239
- * specify one.
240
- * - crs_transform: a default affine transform to use for any bands that do
241
- * not specify one, of the same format as the crs_transform of bands.
242
- * - dimensions: default image cropping dimensions to use for any bands that
243
- * do not specify them.
244
- * - scale: a default scale to use for any bands that do not specify one;
245
- * ignored if crs and crs_transform are specified.
246
- * - region: a polygon specifying a region to download; ignored if crs
247
- * and crs_transform is specified.
248
- * - filePerBand: whether to produce a separate GeoTIFF per band (boolean).
249
- * Defaults to true. If false, a single GeoTIFF is produced and all
250
- * band-level transformations will be ignored.
251
- * - format: the download format. One of: "ZIPPED_GEO_TIFF" (GeoTIFF file(s)
252
- * wrapped in a zip file, default), "GEO_TIFF" (GeoTIFF file),
253
- * "NPY" (NumPy binary format). If "GEO_TIFF" or "NPY", filePerBand
254
- * and all band-level transformations will be ignored. Loading a NumPy
255
- * output results in a structured array.
220
+ * <table>
221
+ * <tr>
222
+ * <td><code> name: </code> a base name to use when constructing
223
+ * filenames. Only applicable when format is "ZIPPED_GEO_TIFF" (default)
224
+ * or filePerBand is true. Defaults to the image id (or "download" for
225
+ * computed images) when format is "ZIPPED_GEO_TIFF" or filePerBand is
226
+ * true, otherwise a random character string is generated. Band names
227
+ * are appended when filePerBand is true.</td>
228
+ * </tr>
229
+ * <tr>
230
+ * <td><code> bands: </code> a description of the bands to download. Must
231
+ * be an array of band names or an array of dictionaries, each with the
232
+ * following keys (optional parameters apply only when filePerBand is
233
+ * true):<ul style="list-style-type:none;">
234
+ * <li><code> id: </code> the name of the band, a string, required.
235
+ * <li><code> crs: </code> an optional CRS string defining the
236
+ * band projection.</li>
237
+ * <li><code> crs_transform: </code> an optional array of 6 numbers
238
+ * specifying an affine transform from the specified CRS, in
239
+ * row-major order: [xScale, xShearing, xTranslation, yShearing,
240
+ * yScale, yTranslation]</li>
241
+ * <li><code> dimensions: </code> an optional array of two integers
242
+ * defining the width and height to which the band is cropped.</li>
243
+ * <li><code> scale: </code> an optional number, specifying the scale
244
+ * in meters of the band; ignored if crs and crs_transform are
245
+ * specified.</li></ul></td>
246
+ * </tr>
247
+ * <tr>
248
+ * <td><code> crs: </code> a default CRS string to use for any bands that
249
+ * do not explicitly specify one.</td>
250
+ * </tr>
251
+ * <tr>
252
+ * <td><code> crs_transform: </code> a default affine transform to use for
253
+ * any bands that do not specify one, of the same format as the
254
+ * <code>crs_transform</code> of bands.</td>
255
+ * </tr>
256
+ * <tr>
257
+ * <td><code> dimensions: </code> default image cropping dimensions to use
258
+ * for any bands that do not specify them.</td>
259
+ * </tr>
260
+ * <tr>
261
+ * <td><code> scale: </code> a default scale to use for any bands that do
262
+ * not specify one; ignored if <code>crs</code> and
263
+ * <code>crs_transform</code> are specified.</td>
264
+ * </tr>
265
+ * <tr>
266
+ * <td><code> region: </code> a polygon specifying a region to download;
267
+ * ignored if <code>crs</code> and <code>crs_transform</code> is
268
+ * specified.</td>
269
+ * </tr>
270
+ * <tr>
271
+ * <td><code> filePerBand: </code> whether to produce a separate GeoTIFF
272
+ * per band (boolean). Defaults to true. If false, a single GeoTIFF is
273
+ * produced and all band-level transformations will be ignored.</td>
274
+ * </tr>
275
+ * <tr>
276
+ * <td><code> format: </code> the download format. One of:
277
+ * <ul style="list-style-type:none;">
278
+ * <li> "ZIPPED_GEO_TIFF" (GeoTIFF file(s) wrapped in a zip file,
279
+ * default)</li>
280
+ * <li> "GEO_TIFF" (GeoTIFF file)</li>
281
+ * <li> "NPY" (NumPy binary format)</li>
282
+ * </ul>
283
+ * If "GEO_TIFF" or "NPY", filePerBand and all band-level transformations
284
+ * will be ignored. Loading a NumPy output results in a structured
285
+ * array.</td>
286
+ * </tr>
287
+ * </table>
256
288
  * @param {function(string?, string=)=} opt_callback An optional
257
289
  * callback. If not supplied, the call is made synchronously.
258
290
  * @return {string|undefined} Returns a download URL, or undefined if a callback
@@ -284,13 +316,19 @@ ee.Image.prototype.getDownloadURL = function(params, opt_callback) {
284
316
  * Applies transformations and returns the thumbId.
285
317
  * @param {!Object} params Parameters identical to ee.data.getMapId, plus,
286
318
  * optionally:
287
- * - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
288
- * dimensions of the thumbnail to render, in pixels. If only one
289
- * number is passed, it is used as the maximum, and the other
290
- * dimension is computed by proportional scaling.
291
- * - region Geospatial region of the image to render, it may be an ee.Geometry,
292
- * GeoJSON, or an array of lat/lon points (E,S,W,N). If not set the
293
- * default is the bounds image.
319
+ * <table>
320
+ * <tr>
321
+ * <td><code> dimensions </code> (a number or pair of numbers in format
322
+ * WIDTHxHEIGHT) Maximum dimensions of the thumbnail to render, in
323
+ * pixels. If only one number is passed, it is used as the maximum,
324
+ * and the other dimension is computed by proportional scaling.</td>
325
+ * </tr>
326
+ * <tr>
327
+ * <td><code> region </code> Geospatial region of the image to render,
328
+ * it may be an ee.Geometry, GeoJSON, or an array of lat/lon
329
+ * points (E,S,W,N). If not set the default is the bounds image.</td>
330
+ * </tr>
331
+ * </table>
294
332
  * @param {function(?ee.data.ThumbnailId, string=)=} opt_callback
295
333
  * An optional callback. If not supplied, the call is made synchronously.
296
334
  * @return {?ee.data.ThumbnailId} The thumb ID and optional token, or null if a
@@ -318,14 +356,22 @@ ee.Image.prototype.getThumbId = function(params, opt_callback) {
318
356
  * Get a thumbnail URL for this image.
319
357
  * @param {!Object} params Parameters identical to ee.data.getMapId, plus,
320
358
  * optionally:
321
- * - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
322
- * dimensions of the thumbnail to render, in pixels. If only one
323
- * number is passed, it is used as the maximum, and the other
324
- * dimension is computed by proportional scaling.
325
- * - region Geospatial region of the image to render, it may be an ee.Geometry,
326
- * GeoJSON, or an array of lat/lon points (E,S,W,N). If not set the
327
- * default is the bounds image.
328
- * - format (string) Either 'png' or 'jpg'.
359
+ * <table>
360
+ * <tr>
361
+ * <td><code> dimensions </code> (a number or pair of numbers in format
362
+ * WIDTHxHEIGHT) Maximum dimensions of the thumbnail to render, in
363
+ * pixels. If only one number is passed, it is used as the maximum,
364
+ * and the other dimension is computed by proportional scaling.</td>
365
+ * </tr>
366
+ * <tr>
367
+ * <td><code> region </code> Geospatial region of the image to render,
368
+ * it may be an ee.Geometry, GeoJSON, or an array of lat/lon
369
+ * points (E,S,W,N). If not set the default is the bounds image.</td>
370
+ * </tr>
371
+ * <tr>
372
+ * <td><code> format </code> (string) Either 'png' or 'jpg'.</td>
373
+ * </tr>
374
+ * </table>
329
375
  * @param {function(string, string=)=} opt_callback An optional
330
376
  * callback. If not supplied, the call is made synchronously.
331
377
  * @return {string|undefined} A thumbnail URL, or undefined if a callback
@@ -433,14 +479,15 @@ ee.Image.combine_ = function(images, opt_names) {
433
479
  * Selects bands from an image.
434
480
  *
435
481
  * @param {...*} var_args One of two possibilities:
436
- * - Any number of non-list arguments. All of these will be interpreted as band
437
- * selectors. These can be band names, regexes, or numeric indices. E.g.
438
- * selected = image.select('a', 'b', 3, 'd');
439
- * - Two lists. The first will be used as band selectors and the second
440
- * as new names for the selected bands. The number of new names must match
441
- * the number of selected bands. E.g.
442
- * selected = image.select(['a', 4], ['newA', 'newB']);
443
- *
482
+ * <ul>
483
+ * <li> Any number of non-list arguments. All of these will be interpreted as
484
+ * band selectors. These can be band names, regexes, or numeric indices.
485
+ * E.g. selected = image.select('a', 'b', 3, 'd');</li>
486
+ * <li> Two lists. The first will be used as band selectors and the second
487
+ * as new names for the selected bands. The number of new names must match
488
+ * the number of selected bands. E.g.
489
+ * selected = image.select(['a', 4], ['newA', 'newB']);</li>
490
+ * </ul>
444
491
  * @return {!ee.Image} An image with the selected bands.
445
492
  * @export
446
493
  */
@@ -114,13 +114,23 @@ ee.ImageCollection.reset = function() {
114
114
  * Get the URL of a tiled thumbnail for this ImageCollection.
115
115
  * @param {!Object} params Parameters identical to ee.data.getMapId, plus,
116
116
  * optionally:
117
- * - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
118
- * dimensions of each thumbnail frame to render, in pixels. If only one
119
- * number is passed, it is used as the maximum, and the other
120
- * dimension is computed by proportional scaling.
121
- * - region (E,S,W,N or GeoJSON) Geospatial region of the image
122
- * to render. By default, the whole image.
123
- * - format (string) Encoding format. Only 'png' or 'jpg' are accepted.
117
+ * <table>
118
+ * <tr>
119
+ * <td><code> dimensions </code> (a number or pair of numbers in
120
+ * format WIDTHxHEIGHT) Maximum dimensions of each thumbnail frame to
121
+ * render, in pixels. If only one number is passed, it is used as the
122
+ * maximum, and the other dimension is computed by proportional
123
+ * scaling.</td>
124
+ * </tr>
125
+ * <tr>
126
+ * <td><code> region </code> (E,S,W,N or GeoJSON) Geospatial region of
127
+ * the image to render. By default, the whole image.</td>
128
+ * </tr>
129
+ * <tr>
130
+ * <td><code> format </code> (string) Encoding format. Only 'png'
131
+ * or 'jpg' are accepted.</td>
132
+ * </tr>
133
+ * </table>
124
134
  * @param {function(string, string=)=} opt_callback An optional
125
135
  * callback which handles the resulting URL string. If not supplied, the
126
136
  * call is made synchronously.
@@ -141,14 +151,25 @@ ee.ImageCollection.prototype.getFilmstripThumbURL = function(params, opt_callbac
141
151
  * Get the URL of an animated thumbnail for this ImageCollection.
142
152
  * @param {!Object} params Parameters identical to ee.data.getMapId, plus,
143
153
  * optionally:
144
- * - dimensions (a number or pair of numbers in format WIDTHxHEIGHT) Maximum
145
- * dimensions of the thumbnail to render, in pixels. If only one
146
- * number is passed, it is used as the maximum, and the other
147
- * dimension is computed by proportional scaling.
148
- * - region (E,S,W,N or GeoJSON) Geospatial region of the image
149
- * to render. By default, the whole image.
150
- * - format (string) Encoding format. Only 'gif' is accepted.
151
- * - framesPerSecond (number) Animation speed.
154
+ * <table>
155
+ * <tr>
156
+ * <td><code> dimensions </code> (a number or pair of numbers in format
157
+ * WIDTHxHEIGHT) Maximum dimensions of the thumbnail to render, in
158
+ * pixels. If only one number is passed, it is used as the maximum, and
159
+ * the other dimension is computed by proportional scaling.</td>
160
+ * </tr>
161
+ * <tr>
162
+ * <td><code> region </code> (E,S,W,N or GeoJSON) Geospatial region of
163
+ * the image to render. By default, the whole image.</td>
164
+ * </tr>
165
+ * <tr>
166
+ * <td><code> format </code> (string) Encoding format. Only 'gif'
167
+ * is accepted.</td>
168
+ * </tr>
169
+ * <tr>
170
+ * <td><code> framesPerSecond </code> (number) Animation speed.</td>
171
+ * </tr>
172
+ * </table>
152
173
  * @param {function(string, string=)=} opt_callback An optional
153
174
  * callback which handles the resulting URL string. If not supplied, the
154
175
  * call is made synchronously.