@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.
- package/.tmp/BUILD +699 -0
- package/.tmp/METADATA +23 -0
- package/.tmp/VERSION_BUILD +47 -0
- package/build/browser.js +164 -122
- package/build/ee_api_js.js +305 -302
- package/build/ee_api_js_debug.js +141 -100
- package/build/ee_api_js_npm.js +164 -122
- package/build/main.js +164 -122
- package/package.json +1 -1
- package/src/apiclient.js +1 -1
- package/src/batch.js +26 -14
- package/src/data.js +253 -101
- package/src/eeapiclient/domain_object.ts +7 -7
- package/src/eeapiclient/multipart_request.ts +4 -1
- package/src/image.js +106 -59
- package/src/imagecollection.js +36 -15
|
@@ -5,7 +5,10 @@ export class MultipartRequest {
|
|
|
5
5
|
private _metadataPayload = '';
|
|
6
6
|
private _payloadPromise: Promise<string>;
|
|
7
7
|
|
|
8
|
-
constructor(
|
|
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
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* format is "ZIPPED_GEO_TIFF"
|
|
224
|
-
*
|
|
225
|
-
* filePerBand is
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
243
|
-
*
|
|
244
|
-
*
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
251
|
-
*
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
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
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
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
|
-
*
|
|
322
|
-
*
|
|
323
|
-
*
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
327
|
-
*
|
|
328
|
-
*
|
|
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
|
-
*
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
441
|
-
*
|
|
442
|
-
*
|
|
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
|
*/
|
package/src/imagecollection.js
CHANGED
|
@@ -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
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
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
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
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.
|