diff --git a/javascript/build/ee_api_js.js b/javascript/build/ee_api_js.js index 302e9403d..98fa9713d 100644 --- a/javascript/build/ee_api_js.js +++ b/javascript/build/ee_api_js.js @@ -47,12 +47,12 @@ function bb(a,b){B(null!=a.length);Array.prototype.splice.call(a,b,1)}function c function fb(a){var b=[];if(0>a-0)return[];for(var c=0;c>>0),cc=function(a){B(a,"Listener can not be null.");if("function"===typeof a)return a;B(a.handleEvent,"An object listener must have handleEvent method.");a[kc]||(a[kc]=function(b){return a.handleEvent(b)}); @@ -74,13 +74,13 @@ Ic.prototype[Symbol.iterator]=function(){return this.values()};Ic.prototype.mb=f function $c(a){if(null==a)throw Error("Cannot deserialize, target constructor was null.");return new a} function Xc(a,b,c,d,e){e=d(e);for(var g=ad(a,e),f=g.P||{},l=g.s||{},m=g.Ma||{},p=n(g.keys||[]),v=p.next(),A={};!v.done;A={Wd:void 0},v=p.next()){v=v.value;var C=b(v,a);if(null!=C){var J=void 0;if(f.hasOwnProperty(v)){if(g.sh&&0===C.length)continue;J=bd(C,b,c,d,!0,!0,f[v])}else if(l.hasOwnProperty(v))J=bd(C,b,c,d,!1,!0,l[v]);else if(m.hasOwnProperty(v))A.Wd=m[v],J=A.Wd.pa?C.map(function(fa){return function(X){return cd(X,fa.Wd,b,c,d)}}(A)):cd(C,A.Wd,b,c,d);else if(Array.isArray(C)){if(g.sh&&0===C.length)continue; J=bd(C,b,c,d,!0,!1)}else J=C instanceof Qc?null:C;c(v,e,J)}}return e}function cd(a,b,c,d,e){for(var g={},f=n(Object.keys(a)),l=f.next();!l.done;l=f.next()){l=l.value;var m=a[l];null!=m&&(g[l]=bd(m,c,d,e,b.ra,b.qa,b.ka))}return g} -function bd(a,b,c,d,e,g,f){if(g&&null==f)throw Error("Cannot deserialize a reference object without a constructor.");return null==a?a:e&&g?a.map(function(l){return Xc(l,b,c,d,f)}):e&&!g?a.map(function(l){return l}):!e&&g?Xc(a,b,c,d,f):a instanceof Qc?null:"object"===typeof a?JSON.parse(JSON.stringify(a)):a}function ad(a,b){if(b instanceof E)a=Sc(b.i());else if(a instanceof E)a=Sc(a.i());else throw Error("Cannot find ClassMetadata.");return a};var dd;var fd=function(a,b){if(b!==ed)throw Error("TrustedResourceUrl is not meant to be built directly");this.ki=a};fd.prototype.toString=function(){return this.ki+""}; -var gd=function(a){if(a instanceof fd&&a.constructor===fd)return a.ki;Na("expected object of type TrustedResourceUrl, got '%s' of type %s",a,xa(a));return"type_error:TrustedResourceUrl"},ed={},hd=function(a){if(void 0===dd){var b=null;var c=r.trustedTypes;if(c&&c.createPolicy)try{b=c.createPolicy("goog#html",{createHTML:Ga,createScript:Ga,createScriptURL:Ga})}catch(d){r.console&&r.console.error(d.message)}dd=b}a=(b=dd)?b.createScriptURL(a):a;return new fd(a,ed)};/* +function bd(a,b,c,d,e,g,f){if(g&&null==f)throw Error("Cannot deserialize a reference object without a constructor.");return null==a?a:e&&g?a.map(function(l){return Xc(l,b,c,d,f)}):e&&!g?a.map(function(l){return l}):!e&&g?Xc(a,b,c,d,f):a instanceof Qc?null:"object"===typeof a?JSON.parse(JSON.stringify(a)):a}function ad(a,b){if(b instanceof E)a=Sc(b.i());else if(a instanceof E)a=Sc(a.i());else throw Error("Cannot find ClassMetadata.");return a};var dd;var fd=function(a,b){if(b!==ed)throw Error("TrustedResourceUrl is not meant to be built directly");this.ji=a};fd.prototype.toString=function(){return this.ji+""}; +var gd=function(a){if(a instanceof fd&&a.constructor===fd)return a.ji;Na("expected object of type TrustedResourceUrl, got '%s' of type %s",a,xa(a));return"type_error:TrustedResourceUrl"},ed={},hd=function(a){if(void 0===dd){var b=null;var c=r.trustedTypes;if(c&&c.createPolicy)try{b=c.createPolicy("goog#html",{createHTML:Ga,createScript:Ga,createScriptURL:Ga})}catch(d){r.console&&r.console.error(d.message)}dd=b}a=(b=dd)?b.createScriptURL(a):a;return new fd(a,ed)};/* SPDX-License-Identifier: Apache-2.0 */ -var id=ia([""]),jd=ja(["\x00"],["\\0"]),kd=ja(["\n"],["\\n"]),ld=ja(["\x00"],["\\u0000"]),md=ia([""]),nd=ja(["\x00"],["\\0"]),od=ja(["\n"],["\\n"]),pd=ja(["\x00"],["\\u0000"]);function qd(a){return Object.isFrozen(a)&&Object.isFrozen(a.raw)}function rd(a){return-1===a.toString().indexOf("`")}var sd=rd(function(a){return a(id)})||rd(function(a){return a(jd)})||rd(function(a){return a(kd)})||rd(function(a){return a(ld)}),td=qd(md)&&qd(nd)&&qd(od)&&qd(pd);var vd=function(a,b){if(b!==ud)throw Error("SafeUrl is not meant to be built directly");this.ji=a};vd.prototype.toString=function(){return this.ji.toString()};var wd=function(a){if(a instanceof vd&&a.constructor===vd)return a.ji;Na("expected object of type SafeUrl, got '"+a+"' of type "+xa(a));return"type_error:SafeUrl"},ud={},xd=function(a){return new vd(a,ud)};xd("about:invalid#zClosurez");xd("about:blank");xd("about:blank");var yd=xd("about:invalid#zClosurez");function zd(a){if("undefined"!==typeof MediaSource&&a instanceof MediaSource)return xd(URL.createObjectURL(a));var b=a.type.match(/^([^;]+)(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i);if(2!==(null==b?void 0:b.length)||!(/^image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon|heic|heif|avif|x-ms-bmp)$/i.test(b[1])||/^video\/(?:mpeg|mp4|ogg|webm|x-matroska|quicktime|x-ms-wmv)$/i.test(b[1])||/^audio\/(?:3gpp2|3gpp|aac|amr|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)$/i.test(b[1])||/^font\/\w+/i.test(b[1])))throw Error("unsafe blob MIME type: "+ -a.type);return xd(URL.createObjectURL(a))}var Ad=[],Bd=function(a){console.warn("A URL with content '"+a+"' was sanitized away.")};-1===Ad.indexOf(Bd)&&Ad.push(Bd);var Cd={},Dd=function(){if(Cd!==Cd)throw Error("SafeStyle is not meant to be built directly");this.ql=""};Dd.prototype.toString=function(){return this.ql.toString()};new Dd;var Ed={},Fd=function(){if(Ed!==Ed)throw Error("SafeStyleSheet is not meant to be built directly");this.pl=""};Fd.prototype.toString=function(){return this.pl.toString()};new Fd;var Gd={},Hd=function(){var a=r.trustedTypes&&r.trustedTypes.emptyHTML||"";if(Gd!==Gd)throw Error("SafeHtml is not meant to be built directly");this.ol=a};Hd.prototype.toString=function(){return this.ol.toString()};new Hd;var Id=function(a,b){this.name=a;this.value=b};Id.prototype.toString=function(){return this.name};var Jd=new Id("OFF",Infinity),Kd=new Id("SEVERE",1E3),Ld=new Id("CONFIG",700),Md=new Id("FINE",500),Nd=function(){this.Dd=0;this.clear()},Od;Nd.prototype.clear=function(){this.Ad=Array(this.Dd);this.kh=-1;this.Jh=!1};var Pd=function(a,b,c){this.reset(a||Jd,b,c,void 0,void 0)};Pd.prototype.reset=function(){}; +var id=ia([""]),jd=ja(["\x00"],["\\0"]),kd=ja(["\n"],["\\n"]),ld=ja(["\x00"],["\\u0000"]),md=ia([""]),nd=ja(["\x00"],["\\0"]),od=ja(["\n"],["\\n"]),pd=ja(["\x00"],["\\u0000"]);function qd(a){return Object.isFrozen(a)&&Object.isFrozen(a.raw)}function rd(a){return-1===a.toString().indexOf("`")}var sd=rd(function(a){return a(id)})||rd(function(a){return a(jd)})||rd(function(a){return a(kd)})||rd(function(a){return a(ld)}),td=qd(md)&&qd(nd)&&qd(od)&&qd(pd);var ud={};var vd=function(){if(ud!==ud)throw Error("Bad secret");};vd.prototype.toString=function(){return this.ki};function wd(a){var b=new vd;b.ki=a;return b}wd("about:blank");var xd=wd("about:invalid#zClosurez");function yd(a){if(a instanceof vd)return a.ki;throw Error("Unexpected type when unwrapping SafeUrl, got '"+a+"' of type '"+typeof a+"'");};function zd(a){if("undefined"!==typeof MediaSource&&a instanceof MediaSource)return wd(URL.createObjectURL(a));var b=a.type.match(/^([^;]+)(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i);if(2!==(null==b?void 0:b.length)||!(/^image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon|heic|heif|avif|x-ms-bmp)$/i.test(b[1])||/^video\/(?:mpeg|mp4|ogg|webm|x-matroska|quicktime|x-ms-wmv)$/i.test(b[1])||/^audio\/(?:3gpp2|3gpp|aac|amr|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)$/i.test(b[1])||/^font\/\w+/i.test(b[1])))throw Error("unsafe blob MIME type: "+ +a.type);return wd(URL.createObjectURL(a))}var Ad=[],Bd=function(a){console.warn("A URL with content '"+a+"' was sanitized away.")};-1===Ad.indexOf(Bd)&&Ad.push(Bd);var Cd={},Dd=function(){if(Cd!==Cd)throw Error("SafeStyle is not meant to be built directly");this.ql=""};Dd.prototype.toString=function(){return this.ql.toString()};new Dd;var Ed={},Fd=function(){if(Ed!==Ed)throw Error("SafeStyleSheet is not meant to be built directly");this.pl=""};Fd.prototype.toString=function(){return this.pl.toString()};new Fd;var Gd={},Hd=function(){var a=r.trustedTypes&&r.trustedTypes.emptyHTML||"";if(Gd!==Gd)throw Error("SafeHtml is not meant to be built directly");this.ol=a};Hd.prototype.toString=function(){return this.ol.toString()};new Hd;var Id=function(a,b){this.name=a;this.value=b};Id.prototype.toString=function(){return this.name};var Jd=new Id("OFF",Infinity),Kd=new Id("SEVERE",1E3),Ld=new Id("CONFIG",700),Md=new Id("FINE",500),Nd=function(){this.Dd=0;this.clear()},Od;Nd.prototype.clear=function(){this.Ad=Array(this.Dd);this.kh=-1;this.Jh=!1};var Pd=function(a,b,c){this.reset(a||Jd,b,c,void 0,void 0)};Pd.prototype.reset=function(){}; var Qd=function(a,b){this.level=null;this.Zk=[];this.parent=(void 0===b?null:b)||null;this.children=[];this.gl={wf:function(){return a}}},Rd=function(a){if(a.level)return a.level;if(a.parent)return Rd(a.parent);Na("Root logger has no level set.");return Jd},Sd=function(a,b){for(;a;)a.Zk.forEach(function(c){c(b)}),a=a.parent},Td=function(){this.entries={};var a=new Qd("");a.level=Ld;this.entries[""]=a},Ud,Vd=function(a,b){var c=a.entries[b];if(c)return c;c=Vd(a,b.slice(0,Math.max(b.lastIndexOf("."), 0)));var d=new Qd(b,c);a.entries[b]=d;c.children.push(d);return d},Wd=function(){Ud||(Ud=new Td);return Ud},Xd=function(a,b,c){var d;if(d=a)if(d=a&&b){d=b.value;var e=a?Rd(Vd(Wd(),a.wf())):Jd;d=d>=e.value}if(d){b=b||Jd;d=Vd(Wd(),a.wf());"function"===typeof c&&(c=c());Od||(Od=new Nd);e=Od;a=a.wf();if(0b.length)){var d=b[0].match(/\r\nContent-ID: ]*)>/)[1],e=Number(b[1].match(/^HTTP\S*\s(\d+)\s/)[1]);c(d,e,b.slice(2).join("\r\n\r\n"))}},Fj=function(){var a=Mj.replace(/\/api$/,"");return"window"in r&&!a.match(/^https?:\/\/content-/)?a.replace(/^(https?:\/\/)(.*\.googleapis\.com)$/,"$1content-$2"):a},Oj=function(a,b,c){var d=[];a&&(d=d.concat(Nj)); b&&d.push("https://www.googleapis.com/auth/devstorage.read_write");a=d=d.concat(c);c=b=0;for(var e={};cg)break;A++}return jk(C.status,function(J){try{return C.getResponseHeader(J)}catch(fa){return null}},C.responseText,l,void 0,e,d,f)},hk=function(a,b,c,d,e,g,f){var l=0,m={url:a,method:c,content:d,headers:e},p=bk,v=null!= g?g:10;m.callback=function(A){A=A.target;if(429==A.getStatus()&&lX||300<=X)return"Server returned HTTP code: "+X+" for "+f+" "+g},A,C;b=b("Content-Type")||"application/json";d=b.replace(/;.*/,"");if("application/json"===d||"text/json"===d)c=p(c),c.parsed? -C=c.parsed:A=c;else if("multipart/mixed"===d){C={};var J=[];Lj(b,c,function(X,ea,Jb){Jb=p(Jb);Jb.parsed&&(C[X]=Jb.parsed);(ea=(Jb.parsed?"":Jb)||v(ea))&&J.push(X+": "+ea)});J.length&&(A=J.join("\n"))}else var fa="Response was unexpectedly not JSON, but "+d;A=A||v(a)||fa;if(e)return e(C,A),null;if(!A)return C;throw Error(A);},Sj=function(a){var b=function(){Pj||(Pj=function(c,d){r.google.accounts.oauth2.initTokenClient({client_id:c.client_id,callback:d,scope:c.scope}).requestAccessToken()});a()};t(r.default_gsi)? +var p=function(X){try{var ea=JSON.parse(X);return!(t(ea)&&"error"in ea&&"message"in ea.error)||l&&l(ea)?{parsed:ea}:ea.error.message}catch(Ib){return"Invalid JSON: "+X}},v=function(X){if(0===X)return"Failed to contact Earth Engine servers. Please check your connection, firewall, or browser extension settings.";if(200>X||300<=X)return"Server returned HTTP code: "+X+" for "+f+" "+g},A,C;b=b("Content-Type")||"application/json";d=b.replace(/;.*/,"");if("application/json"===d||"text/json"===d)c=p(c),c.parsed? +C=c.parsed:A=c;else if("multipart/mixed"===d){C={};var J=[];Lj(b,c,function(X,ea,Ib){Ib=p(Ib);Ib.parsed&&(C[X]=Ib.parsed);(ea=(Ib.parsed?"":Ib)||v(ea))&&J.push(X+": "+ea)});J.length&&(A=J.join("\n"))}else var fa="Response was unexpectedly not JSON, but "+d;A=A||v(a)||fa;if(e)return e(C,A),null;if(!A)return C;throw Error(A);},Sj=function(a){var b=function(){Pj||(Pj=function(c,d){r.google.accounts.oauth2.initTokenClient({client_id:c.client_id,callback:d,scope:c.scope}).requestAccessToken()});a()};t(r.default_gsi)? b():Ui(b)},Tj=function(a,b,c){if(c.access_token){b=c.token_type+" "+c.access_token;if(c.expires_in||0===c.expires_in){c=900*c.expires_in;var d=setTimeout(Uj,.9*c);void 0!==d.unref&&d.unref();Vj=Date.now()+c}Xj=b;a&&a()}else b&&b(c.error||"Unknown error.")},Gj=function(a){var b=new ke;a=n(Object.entries(a));for(var c=a.next();!c.done;c=a.next()){var d=n(c.value);c=d.next().value;d=d.next().value;b.set(c,d)}return b},gk=[],ik=new Hi(function(){var a=gk.shift();if(a){var b=a.url,c=a.callback,d=a.method, e=a.content;a=a.headers;var g=kk,f=new nj;qj.push(f);c&&f.Xa("complete",c);f.Wc("ready",f.Qk);g&&(f.zc=Math.max(0,g));f.send(b,d,e,a)}0==gk.length||ik.qf()},350),Mj=null,Zj=null,ak=null,fk=null,ek=qc,Xj=null,Vj=null,Qj=null,Rj=[],Pj=null,Nj=["https://www.googleapis.com/auth/earthengine","https://www.googleapis.com/auth/cloud-platform"],dk=null,Yj=!1,kk=0,bk=null;w("ee.api.ListAssetsResponse",Vg);w("ee.api.EarthEngineAsset",Rf);w("ee.api.Operation",Yg);w("ee.api.ListFeaturesResponse",Wg); w("ee.api.FeatureViewLocation",Uf);var lk=function(){};lk.prototype.Eh=function(){return null};var mk=function(){};w("ee.Encodable.SourceFrame",mk); @@ -639,7 +639,7 @@ Mo.prototype.start=Mo.prototype.start;var Po=function(a,b,c,d,e,g,f,l,m,p,v,A){v var So=function(a,b,c,d,e,g,f,l,m,p,v,A,C,J,fa,X){var ea=R(So,arguments);ea=Qo(ea,"DRIVE","EXPORT_IMAGE");return Oo(ea)};w("module$contents$ee$batch_Export.image.toDrive",So);var To=function(a,b,c,d,e,g,f,l,m,p,v,A,C,J){var fa=R(To,arguments);fa=Qo(fa,"GOOGLE_CLOUD_STORAGE","EXPORT_TILES");return Oo(fa)};w("module$contents$ee$batch_Export.map.toCloudStorage",To);var Uo=function(a,b,c,d,e,g,f,l){var m=R(Uo,arguments);m=Qo(m,"GOOGLE_CLOUD_STORAGE","EXPORT_FEATURES");return Oo(m)}; w("module$contents$ee$batch_Export.table.toCloudStorage",Uo);var Vo=function(a,b,c,d,e,g,f,l){var m=R(Vo,arguments);m.type="EXPORT_FEATURES";m=Qo(m,"DRIVE","EXPORT_FEATURES");return Oo(m)};w("module$contents$ee$batch_Export.table.toDrive",Vo);var Wo=function(a,b,c,d,e){var g=R(Wo,arguments);g=Qo(g,"ASSET","EXPORT_FEATURES");return Oo(g)};w("module$contents$ee$batch_Export.table.toAsset",Wo);var Xo=function(a,b,c,d,e,g,f,l){var m=R(Xo,arguments);m=Qo(m,"FEATURE_VIEW","EXPORT_FEATURES");return Oo(m)}; w("module$contents$ee$batch_Export.table.toFeatureView",Xo);var Yo=function(a,b,c,d,e,g,f,l){var m=R(Yo,arguments);m=Qo(m,"BIGQUERY","EXPORT_FEATURES");return Oo(m)};w("module$contents$ee$batch_Export.table.toBigQuery",Yo);var Zo=function(a,b,c,d,e,g,f,l,m,p,v,A,C){var J=R(Zo,arguments);J=Qo(J,"GOOGLE_CLOUD_STORAGE","EXPORT_VIDEO");return Oo(J)};w("module$contents$ee$batch_Export.video.toCloudStorage",Zo); -var $o=function(a,b,c,d,e,g,f,l,m,p,v,A,C){var J=R($o,arguments);J=Qo(J,"DRIVE","EXPORT_VIDEO");return Oo(J)};w("module$contents$ee$batch_Export.video.toDrive",$o);var ap=function(a,b,c,d,e,g,f,l,m,p,v,A,C,J,fa,X,ea,Jb,$q,ar,br){var xj=R(ap,arguments);xj=Qo(xj,"GOOGLE_CLOUD_STORAGE","EXPORT_VIDEO_MAP");return Oo(xj)};w("module$contents$ee$batch_Export.videoMap.toCloudStorage",ap);var bp=function(a,b,c,d){var e=R(bp,arguments);e=Qo(e,"ASSET","EXPORT_CLASSIFIER");return Oo(e)}; +var $o=function(a,b,c,d,e,g,f,l,m,p,v,A,C){var J=R($o,arguments);J=Qo(J,"DRIVE","EXPORT_VIDEO");return Oo(J)};w("module$contents$ee$batch_Export.video.toDrive",$o);var ap=function(a,b,c,d,e,g,f,l,m,p,v,A,C,J,fa,X,ea,Ib,$q,ar,br){var xj=R(ap,arguments);xj=Qo(xj,"GOOGLE_CLOUD_STORAGE","EXPORT_VIDEO_MAP");return Oo(xj)};w("module$contents$ee$batch_Export.videoMap.toCloudStorage",ap);var bp=function(a,b,c,d){var e=R(bp,arguments);e=Qo(e,"ASSET","EXPORT_CLASSIFIER");return Oo(e)}; w("module$contents$ee$batch_Export.classifier.toAsset",bp); var No=function(a){var b=function(d){return d in a},c=cp.find(b);B(1===Za(cp,b),'Expected a single "image", "collection" or "classifier" key.');b=a[c];if(!(b instanceof N||b instanceof Y||b instanceof Z||b instanceof S||b instanceof O))throw Error("Unknown element type provided: "+typeof b+". Expected: ee.Image, ee.ImageCollection, ee.FeatureCollection, ee.Element or ee.ComputedObject.");delete a[c];return b},Qo=function(a,b,c){var d=void 0===d?!0:d;var e={type:c};Object.assign(e,a);switch(c){case "EXPORT_IMAGE":null== e.fileFormat&&(e.fileFormat="GeoTIFF");a=e.fileFormat;null==a&&(a="GEO_TIFF");a=a.toUpperCase();switch(a){case "TIFF":case "TIF":case "GEO_TIFF":case "GEOTIFF":a="GEO_TIFF";break;case "TF_RECORD":case "TF_RECORD_IMAGE":case "TFRECORD":a="TF_RECORD_IMAGE";break;default:throw Error("Invalid file format "+a+". Supported formats are: 'GEOTIFF', 'TFRECORD'.");}e.fileFormat=a;null!=e.formatOptions&&(a=dp(e,a),delete e.formatOptions,Object.assign(e,a));e=ep(e,b);null!=e.crsTransform&&(e.crs_transform=e.crsTransform, @@ -691,7 +691,7 @@ pq.prototype.J=function(){D.prototype.J.call(this);this.Hc();this.la.remove();th vq.prototype.Lc=function(){var a=new fq;a.Xa("loadend",function(){this.Ad=a.ca.result;pq.prototype.Lc.call(this)},void 0,this);a.readAsArrayBuffer(this.Bi)};var wq=function(a){D.call(this);this.Rc={};this.Qc={};this.Tb=new Zp(this);this.X=a;this.Ye=!1};x(wq,D);var xq=["load","abort","error"],yq=function(a,b,c){if(c="string"===typeof c?c:c.src)a.Ye=!1,a.Rc[b]={src:c,eh:null}},zq=function(a,b){delete a.Rc[b];var c=a.Qc[b];c&&(delete a.Qc[b],a.Tb.te(c,xq,a.ci))}; wq.prototype.start=function(){var a=this.Rc;Lb(a).forEach(function(b){var c=a[b];if(c&&(delete a[b],!this.Sa)){if(this.X){var d=this.X;d=(d?new Zh(Yh(d)):Ja||(Ja=new Zh)).Rk("IMG")}else d=new Image;c.eh&&(d.crossOrigin=c.eh);this.Tb.Xa(d,xq,this.ci);this.Qc[b]=d;d.id=b;d.src=c.src}},this)}; wq.prototype.ci=function(a){var b=a.currentTarget;if(b){if("readystatechange"==a.type)if("complete"==b.readyState)a.type="load";else return;"undefined"==typeof b.naturalWidth&&("load"==a.type?(b.naturalWidth=b.width,b.naturalHeight=b.height):(b.naturalWidth=0,b.naturalHeight=0));zq(this,b.id);this.dispatchEvent({type:a.type,target:b});!this.Sa&&Pb(this.Qc)&&Pb(this.Rc)&&!this.Ye&&(this.Ye=!0,this.dispatchEvent("complete"))}};wq.prototype.J=function(){delete this.Rc;delete this.Qc;Ha(this.Tb);wq.L.J.call(this)};var Aq=function(a,b){hq.call(this,a,b)};q(Aq,hq);Aq.prototype.fh=function(a,b,c,d){return new Bq(a,b,c,d)};w("ee.layers.ImageOverlay",Aq);var Bq=function(a,b,c,d){pq.call(this,a,b,c,d);this.fe=Cq;this.Hh=this.ga=this.Sd=null;this.Zc=""};q(Bq,pq); -Bq.prototype.Lc=function(){try{var a=zd(this.Bi);this.Zc=wd(a);var b=this.Zc!==yd.toString()?this.Zc:this.Ca}catch(c){b=this.Ca}this.ga=new wq;yq(this.ga,this.la.id+"-image",b);this.Hh=ac(this.ga,Dq,function(c){"load"==c.type?(this.Sd=c.target,pq.prototype.Lc.call(this)):this.jd()},void 0,this);this.ga.start()};Bq.prototype.Hc=function(){pq.prototype.Hc.call(this);this.ga&&(jc(this.Hh),Ha(this.ga))};Bq.prototype.J=function(){pq.prototype.J.call(this);this.Zc&&URL.revokeObjectURL(this.Zc)}; +Bq.prototype.Lc=function(){try{var a=zd(this.Bi);this.Zc=yd(a);var b=this.Zc!==xd.toString()?this.Zc:this.Ca}catch(c){b=this.Ca}this.ga=new wq;yq(this.ga,this.la.id+"-image",b);this.Hh=ac(this.ga,Dq,function(c){"load"==c.type?(this.Sd=c.target,pq.prototype.Lc.call(this)):this.jd()},void 0,this);this.ga.start()};Bq.prototype.Hc=function(){pq.prototype.Hc.call(this);this.ga&&(jc(this.Hh),Ha(this.ga))};Bq.prototype.J=function(){pq.prototype.J.call(this);this.Zc&&URL.revokeObjectURL(this.Zc)}; var Cq=function(a){a.la.appendChild(a.Sd)},Dq=["load","abort","error"];var Eq=function(a){for(var b=arguments[0],c=1;cthis.kl)return!1;this.Kg++;zq(this.ga,this.fa);setTimeout(u(this.Bl,this),0);return!0}; -h.Bl=function(){if(!this.kc){var a=u(function(d){this.kc||(yq(this.ga,this.fa,d),ac(this.ga,Xq,u(this.Yk,this)),this.ga.start())},this),b=this.getUrl();if(re(b).Ba.Pb("profiling")){var c=new nj;c.xc="blob";c.Xa("complete",u(function(){this.li=c.getResponseHeader("X-Earth-Engine-Computation-Profile")||null;if(200<=c.getStatus()&&300>c.getStatus())try{var d=wd(zd(zj(c)));var e=d!==yd.toString()}catch(g){}a(e?d:b)},this));c.Wc("ready",u(c.Ra,c));c.send(b,"GET")}else a(b)}};h.Kg=0;h.kc=!1;h.ga=null; +h.Bl=function(){if(!this.kc){var a=u(function(d){this.kc||(yq(this.ga,this.fa,d),ac(this.ga,Xq,u(this.Yk,this)),this.ga.start())},this),b=this.getUrl();if(re(b).Ba.Pb("profiling")){var c=new nj;c.xc="blob";c.Xa("complete",u(function(){this.li=c.getResponseHeader("X-Earth-Engine-Computation-Profile")||null;if(200<=c.getStatus()&&300>c.getStatus())try{var d=yd(zd(zj(c)));var e=d!==xd.toString()}catch(g){}a(e?d:b)},this));c.Wc("ready",u(c.Ra,c));c.send(b,"GET")}else a(b)}};h.Kg=0;h.kc=!1;h.ga=null; h.Mi=null;h.Ja=null;h.li=null;var Xq=["load","abort","error"],Yq=function(){y.call(this);this.Ea=!1};q(Yq,y);Yq.prototype.setActive=function(a){this.Ea=a};Yq.prototype.isActive=function(){return this.Ea};var Tq=function(a,b){Oq.call(this,a,b)};q(Tq,Oq);Tq.prototype.bf=function(){return new Yq};Tq.prototype.Ed=function(a){a.Ra()};Tq.prototype.Sf=function(a){return!a.Sa&&!a.isActive()};var Zq=function(a,b,c,d,e){Nc.call(this,a,b,c,d,e);this.minZoom=d.minZoom||0;this.maxZoom=d.maxZoom||20;if(!window.google||!window.google.maps)throw Error("Google Maps API hasn't been initialized.");this.tileSize=d.tileSize||new google.maps.Size(256,256);this.name=d.name;this.wg=new Ic;this.Tf=1;this.ua=e||null};q(Zq,Nc);h=Zq.prototype;h.Oe=function(a){return bc(this,"tileevent",a)};h.bg=function(a){jc(a)}; h.getTile=function(a,b,c){if(ba.y||a.y>=1< groups.length)) { var id = groups[0].match(/\r\nContent-ID: ]*)>/)[1], status = Number(groups[1].match(/^HTTP\S*\s(\d+)\s/)[1]), text = groups.slice(2).join("\r\n\r\n"); handle(id, status, text); @@ -19388,8 +19266,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.398"; - "0.1.398" === version && (version = "latest"); + var headers = {"Content-Type":contentType}, version = "0.1.399"; + "0.1.399" === 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) { @@ -19504,7 +19382,7 @@ module$contents$ee$apiclient_apiclient.ensureAuthLibLoaded_ = function(callback) callback(); }; (function() { - goog.isObject(goog.global.default_gsi) ? done() : goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$96)).addCallback(done); + goog.isObject(goog.global.default_gsi) ? done() : goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$99)).addCallback(done); })(); }; module$contents$ee$apiclient_apiclient.handleAuthResult_ = function(success, error, result) { @@ -19522,8 +19400,8 @@ module$contents$ee$apiclient_apiclient.handleAuthResult_ = function(success, err } }; module$contents$ee$apiclient_apiclient.makeRequest_ = function(params) { - for (var request = new goog.Uri.QueryData(), $jscomp$iter$42 = $jscomp.makeIterator(Object.entries(params)), $jscomp$key$294235699$98$ = $jscomp$iter$42.next(); !$jscomp$key$294235699$98$.done; $jscomp$key$294235699$98$ = $jscomp$iter$42.next()) { - var $jscomp$destructuring$var47 = $jscomp.makeIterator($jscomp$key$294235699$98$.value), name = $jscomp$destructuring$var47.next().value, item = $jscomp$destructuring$var47.next().value; + for (var request = new goog.Uri.QueryData(), $jscomp$iter$42 = $jscomp.makeIterator(Object.entries(params)), $jscomp$key$294235699$101$ = $jscomp$iter$42.next(); !$jscomp$key$294235699$101$.done; $jscomp$key$294235699$101$ = $jscomp$iter$42.next()) { + var $jscomp$destructuring$var47 = $jscomp.makeIterator($jscomp$key$294235699$101$.value), name = $jscomp$destructuring$var47.next().value, item = $jscomp$destructuring$var47.next().value; request.set(name, item); } return request; @@ -24738,6 +24616,7 @@ goog.events.EventHandler.prototype.disposeInternal = function() { goog.events.EventHandler.prototype.handleEvent = function(e) { throw Error("EventHandler.handleEvent not implemented"); }; +goog.fs = {}; goog.fs.DOMErrorLike = function() { }; goog.fs.Error = function(error, action) { diff --git a/javascript/build/ee_api_js_npm.js b/javascript/build/ee_api_js_npm.js index 9850f88af..11419e74a 100644 --- a/javascript/build/ee_api_js_npm.js +++ b/javascript/build/ee_api_js_npm.js @@ -6388,163 +6388,41 @@ function module$contents$safevalues$internals$string_literal_isTemplateObject(te return Array.isArray(templateObj) && Array.isArray(templateObj.raw) && templateObj.length === templateObj.raw.length && (module$contents$safevalues$internals$string_literal_isTranspiled || templateObj !== templateObj.raw) && (module$contents$safevalues$internals$string_literal_isTranspiled && !module$contents$safevalues$internals$string_literal_frozenTSA || module$contents$safevalues$internals$string_literal_checkFrozen(templateObj)) ? !0 : !1; } -;goog.fs = {}; -goog.fs.url = {}; -goog.fs.url.createObjectUrl = function(obj) { - return goog.fs.url.getUrlObject_().createObjectURL(obj); -}; -goog.fs.url.revokeObjectUrl = function(url) { - goog.fs.url.getUrlObject_().revokeObjectURL(url); -}; -goog.fs.url.UrlObject_ = function() { -}; -goog.fs.url.UrlObject_.prototype.createObjectURL = function(arg) { -}; -goog.fs.url.UrlObject_.prototype.revokeObjectURL = function(s) { -}; -goog.fs.url.getUrlObject_ = function() { - var urlObject = goog.fs.url.findUrlObject_(); - if (null != urlObject) { - return urlObject; - } - throw Error("This browser doesn't seem to support blob URLs"); -}; -goog.fs.url.findUrlObject_ = function() { - return void 0 !== goog.global.URL && void 0 !== goog.global.URL.createObjectURL ? goog.global.URL : void 0 !== goog.global.createObjectURL ? goog.global : null; -}; -goog.fs.url.browserSupportsObjectUrls = function() { - return null != goog.fs.url.findUrlObject_(); -}; -goog.html.SafeUrl = function(value, token) { - if (goog.DEBUG && token !== goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_) { - throw Error("SafeUrl is not meant to be built directly"); - } - this.privateDoNotAccessOrElseSafeUrlWrappedValue_ = value; -}; -goog.html.SafeUrl.prototype.toString = function() { - return this.privateDoNotAccessOrElseSafeUrlWrappedValue_.toString(); -}; -goog.html.SafeUrl.INNOCUOUS_STRING = "about:invalid#zClosurez"; -goog.html.SafeUrl.unwrap = function(safeUrl) { - if (safeUrl instanceof goog.html.SafeUrl && safeUrl.constructor === goog.html.SafeUrl) { - return safeUrl.privateDoNotAccessOrElseSafeUrlWrappedValue_; - } - goog.asserts.fail("expected object of type SafeUrl, got '" + safeUrl + "' of type " + goog.typeOf(safeUrl)); - return "type_error:SafeUrl"; -}; -goog.html.SafeUrl.fromConstant = function(url) { - var str = goog.string.Const.unwrap(url); - if (goog.DEBUG && "javascript:" === goog.html.SafeUrl.extractScheme(str)) { - throw Error("Building a SafeUrl with a javascript scheme is not supported"); - } - return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(str); -}; -goog.html.SAFE_MIME_TYPE_PATTERN_ = RegExp('^(?:audio/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)|font/\\w+|image/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon|heic|heif)|video/(?:mpeg|mp4|ogg|webm|quicktime|x-matroska))(?:;\\w+=(?:\\w+|"[\\w;,= ]+"))*$', "i"); -goog.html.SafeUrl.isSafeMimeType = function(mimeType) { - return goog.html.SAFE_MIME_TYPE_PATTERN_.test(mimeType); -}; -goog.html.SafeUrl.fromBlob = function(blob) { - var url = goog.html.SafeUrl.isSafeMimeType(blob.type) ? goog.fs.url.createObjectUrl(blob) : goog.html.SafeUrl.INNOCUOUS_STRING; - return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(url); -}; -goog.html.DATA_URL_PATTERN_ = /^data:(.*);base64,[a-z0-9+\/]+=*$/i; -goog.html.SafeUrl.tryFromDataUrl = function(dataUrl) { - dataUrl = String(dataUrl); - var filteredDataUrl = dataUrl.replace(/(%0A|%0D)/g, ""); - return filteredDataUrl.match(goog.html.DATA_URL_PATTERN_) ? goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(filteredDataUrl) : null; -}; -goog.html.SafeUrl.fromDataUrl = function(dataUrl) { - return goog.html.SafeUrl.tryFromDataUrl(dataUrl) || goog.html.SafeUrl.INNOCUOUS_URL; -}; -goog.html.SafeUrl.fromTrustedResourceUrl = function(trustedResourceUrl) { - return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.TrustedResourceUrl.unwrap(trustedResourceUrl)); -}; -goog.html.SAFE_URL_PATTERN_ = /^(?:(?:https?|mailto|ftp):|[^:/?#]*(?:[/?#]|$))/i; -goog.html.SafeUrl.trySanitize = function(url) { - if (url instanceof goog.html.SafeUrl) { - return url; - } - url = String(url); - return goog.html.SAFE_URL_PATTERN_.test(url) ? goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(url) : goog.html.SafeUrl.tryFromDataUrl(url); -}; -goog.html.SafeUrl.sanitize = function(url) { - return goog.html.SafeUrl.trySanitize(url) || goog.html.SafeUrl.INNOCUOUS_URL; -}; -goog.html.SafeUrl.sanitizeAssertUnchanged = function(url, opt_allowDataUrl) { - if (url instanceof goog.html.SafeUrl) { - return url; - } - url = String(url); - if (opt_allowDataUrl && /^data:/i.test(url)) { - var safeUrl = goog.html.SafeUrl.fromDataUrl(url); - if (safeUrl.toString() == url) { - return safeUrl; - } - } - goog.asserts.assert(goog.html.SAFE_URL_PATTERN_.test(url), "%s does not match the safe URL pattern", url) || (url = goog.html.SafeUrl.INNOCUOUS_STRING); - return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(url); -}; -goog.html.SafeUrl.ASSUME_IMPLEMENTS_URL_API_GOOG = 2020 <= goog.FEATURESET_YEAR; -goog.html.SafeUrl.supportsURLAPI = function() { - if (goog.html.SafeUrl.ASSUME_IMPLEMENTS_URL_API_GOOG) { - return !0; - } - try { - return new URL("s://g"), !0; - } catch (e) { - return !1; - } -}(); -goog.html.SafeUrl.legacyExtractScheme = function(url) { - var aTag = document.createElement("a"); - try { - aTag.href = url; - } catch (e) { - return; - } - var protocol = aTag.protocol; - return ":" === protocol || "" === protocol ? "https:" : protocol; -}; -goog.html.SafeUrl.extractScheme = function(url) { - if (!goog.html.SafeUrl.supportsURLAPI) { - return goog.html.SafeUrl.legacyExtractScheme(url); - } - try { - var parsedUrl = new URL(url); - } catch (e) { - return "https:"; - } - return parsedUrl.protocol; -}; -goog.html.SafeUrl.sanitizeJavascriptUrlAssertUnchanged = function(url) { - if (url instanceof goog.html.SafeUrl) { - return url; +;var module$exports$safevalues$internals$secrets = {}, module$contents$safevalues$internals$secrets_module = module$contents$safevalues$internals$secrets_module || {id:"third_party/javascript/safevalues/internals/secrets.closure.js"}; +module$exports$safevalues$internals$secrets.secretToken = {}; +function module$contents$safevalues$internals$secrets_ensureTokenIsValid(token) { + if (goog.DEBUG && token !== module$exports$safevalues$internals$secrets.secretToken) { + throw Error("Bad secret"); } - url = String(url); - var parsedScheme = goog.html.SafeUrl.extractScheme(url); - goog.asserts.assert("javascript:" !== parsedScheme, "%s is a javascript: URL", url) || (url = goog.html.SafeUrl.INNOCUOUS_STRING); - return goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(url); +} +module$exports$safevalues$internals$secrets.ensureTokenIsValid = module$contents$safevalues$internals$secrets_ensureTokenIsValid; +var module$exports$safevalues$internals$url_impl = {}, module$contents$safevalues$internals$url_impl_module = module$contents$safevalues$internals$url_impl_module || {id:"third_party/javascript/safevalues/internals/url_impl.closure.js"}; +module$exports$safevalues$internals$url_impl.SafeUrl = function(token) { + goog.DEBUG && module$contents$safevalues$internals$secrets_ensureTokenIsValid(token); }; -goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_ = {}; -goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse = function(url) { - return new goog.html.SafeUrl(url, goog.html.SafeUrl.CONSTRUCTOR_TOKEN_PRIVATE_); +module$exports$safevalues$internals$url_impl.SafeUrl.prototype.toString = function() { + return this.privateDoNotAccessOrElseWrappedUrl; }; -goog.html.SafeUrl.INNOCUOUS_URL = goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse(goog.html.SafeUrl.INNOCUOUS_STRING); -goog.html.SafeUrl.ABOUT_BLANK = goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse("about:blank"); -var module$exports$safevalues$internals$url_impl = {}, module$contents$safevalues$internals$url_impl_module = module$contents$safevalues$internals$url_impl_module || {id:"third_party/javascript/safevalues/internals/url_impl.closure.js"}; -module$exports$safevalues$internals$url_impl.SafeUrl = goog.html.SafeUrl; -function module$contents$safevalues$internals$url_impl_createUrlInternal(url) { - return (0,goog.html.SafeUrl.createSafeUrlSecurityPrivateDoNotAccessOrElse)(url); +var module$contents$safevalues$internals$url_impl_UrlImpl = module$exports$safevalues$internals$url_impl.SafeUrl; +function module$contents$safevalues$internals$url_impl_createUrlInternal(urlValue) { + var url = new module$exports$safevalues$internals$url_impl.SafeUrl(module$exports$safevalues$internals$secrets.secretToken); + url.privateDoNotAccessOrElseWrappedUrl = urlValue; + return url; } module$exports$safevalues$internals$url_impl.createUrlInternal = module$contents$safevalues$internals$url_impl_createUrlInternal; module$exports$safevalues$internals$url_impl.ABOUT_BLANK = module$contents$safevalues$internals$url_impl_createUrlInternal("about:blank"); module$exports$safevalues$internals$url_impl.INNOCUOUS_URL = module$contents$safevalues$internals$url_impl_createUrlInternal("about:invalid#zClosurez"); function module$contents$safevalues$internals$url_impl_isUrl(value) { - return value instanceof goog.html.SafeUrl; + return value instanceof module$exports$safevalues$internals$url_impl.SafeUrl; } module$exports$safevalues$internals$url_impl.isUrl = module$contents$safevalues$internals$url_impl_isUrl; function module$contents$safevalues$internals$url_impl_unwrapUrl(value) { - return goog.html.SafeUrl.unwrap(value); + if (module$contents$safevalues$internals$url_impl_isUrl(value)) { + return value.privateDoNotAccessOrElseWrappedUrl; + } + var message = ""; + goog.DEBUG && (message = "Unexpected type when unwrapping SafeUrl, got '" + value + "' of type '" + typeof value + "'"); + throw Error(message); } module$exports$safevalues$internals$url_impl.unwrapUrl = module$contents$safevalues$internals$url_impl_unwrapUrl; var module$exports$safevalues$builders$url_builders = {}, module$contents$safevalues$builders$url_builders_module = module$contents$safevalues$builders$url_builders_module || {id:"third_party/javascript/safevalues/builders/url_builders.closure.js"}; @@ -6687,7 +6565,7 @@ function module$contents$safevalues$builders$url_builders_extractScheme(url) { } module$exports$safevalues$builders$url_builders.extractScheme = module$contents$safevalues$builders$url_builders_extractScheme; var module$contents$safevalues$builders$url_builders_ALLOWED_SCHEMES = ["data:", "http:", "https:", "mailto:", "ftp:"]; -module$exports$safevalues$builders$url_builders.IS_NOT_JAVASCRIPT_URL_PATTERN = /^\s*(?!javascript:)(?:[a-z0-9+.-]+:|[^:\/?#]*(?:[\/?#]|$))/i; +module$exports$safevalues$builders$url_builders.IS_NOT_JAVASCRIPT_URL_PATTERN = /^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i; function module$contents$safevalues$builders$url_builders_hasJavascriptUrlScheme(url) { return !module$exports$safevalues$builders$url_builders.IS_NOT_JAVASCRIPT_URL_PATTERN.test(url); } @@ -6700,7 +6578,7 @@ function module$contents$safevalues$builders$url_builders_sanitizeJavaScriptUrl( } module$exports$safevalues$builders$url_builders.sanitizeJavaScriptUrl = module$contents$safevalues$builders$url_builders_sanitizeJavaScriptUrl; function module$contents$safevalues$builders$url_builders_unwrapUrlOrSanitize(url) { - return url instanceof goog.html.SafeUrl ? module$contents$safevalues$internals$url_impl_unwrapUrl(url) : module$contents$safevalues$builders$url_builders_sanitizeJavaScriptUrl(url); + return url instanceof module$exports$safevalues$internals$url_impl.SafeUrl ? module$contents$safevalues$internals$url_impl_unwrapUrl(url) : module$contents$safevalues$builders$url_builders_sanitizeJavaScriptUrl(url); } module$exports$safevalues$builders$url_builders.unwrapUrlOrSanitize = module$contents$safevalues$builders$url_builders_unwrapUrlOrSanitize; function module$contents$safevalues$builders$url_builders_restrictivelySanitizeUrl(url) { @@ -6746,14 +6624,6 @@ module$exports$safevalues$dom$elements$button.setFormaction = function(button, u var sanitizedUrl = module$contents$safevalues$builders$url_builders_unwrapUrlOrSanitize(url); void 0 !== sanitizedUrl && (button.formAction = sanitizedUrl); }; -var module$exports$safevalues$internals$secrets = {}, module$contents$safevalues$internals$secrets_module = module$contents$safevalues$internals$secrets_module || {id:"third_party/javascript/safevalues/internals/secrets.closure.js"}; -module$exports$safevalues$internals$secrets.secretToken = {}; -function module$contents$safevalues$internals$secrets_ensureTokenIsValid(token) { - if (goog.DEBUG && token !== module$exports$safevalues$internals$secrets.secretToken) { - throw Error("Bad secret"); - } -} -module$exports$safevalues$internals$secrets.ensureTokenIsValid = module$contents$safevalues$internals$secrets_ensureTokenIsValid; var module$exports$safevalues$internals$attribute_impl = {}, module$contents$safevalues$internals$attribute_impl_module = module$contents$safevalues$internals$attribute_impl_module || {id:"third_party/javascript/safevalues/internals/attribute_impl.closure.js"}; module$exports$safevalues$internals$attribute_impl.SafeAttributePrefix = function() { }; @@ -6922,6 +6792,14 @@ goog.dom.tags.VOID_TAGS_ = {area:!0, base:!0, br:!0, col:!0, command:!0, embed:! goog.dom.tags.isVoidTag = function(tagName) { return !0 === goog.dom.tags.VOID_TAGS_[tagName]; }; +var module$exports$safevalues$for_closure$index = {}, module$contents$safevalues$for_closure$index_module = module$contents$safevalues$for_closure$index_module || {id:"third_party/javascript/safevalues/for_closure/index.closure.js"}; +module$exports$safevalues$for_closure$index.sanitizeUrl = module$contents$safevalues$builders$url_builders_sanitizeUrl; +module$exports$safevalues$for_closure$index.SafeUrl = module$exports$safevalues$internals$url_impl.SafeUrl; +module$exports$safevalues$for_closure$index.unwrapUrl = module$contents$safevalues$internals$url_impl_unwrapUrl; +var module$exports$safevalues$for_closure = {}; +module$exports$safevalues$for_closure.sanitizeUrl = module$contents$safevalues$builders$url_builders_sanitizeUrl; +module$exports$safevalues$for_closure.SafeUrl = module$exports$safevalues$internals$url_impl.SafeUrl; +module$exports$safevalues$for_closure.unwrapUrl = module$contents$safevalues$internals$url_impl_unwrapUrl; var module$contents$goog$html$SafeStyle_CONSTRUCTOR_TOKEN_PRIVATE = {}, module$contents$goog$html$SafeStyle_SafeStyle = function(value, token) { if (goog.DEBUG && token !== module$contents$goog$html$SafeStyle_CONSTRUCTOR_TOKEN_PRIVATE) { throw Error("SafeStyle is not meant to be built directly"); @@ -6973,8 +6851,8 @@ module$contents$goog$html$SafeStyle_SafeStyle.concat = function(var_args) { module$contents$goog$html$SafeStyle_SafeStyle.EMPTY = module$contents$goog$html$SafeStyle_SafeStyle.createSafeStyleSecurityPrivateDoNotAccessOrElse(""); module$contents$goog$html$SafeStyle_SafeStyle.INNOCUOUS_STRING = "zClosurez"; function module$contents$goog$html$SafeStyle_sanitizePropertyValue(value) { - if (value instanceof goog.html.SafeUrl) { - return 'url("' + goog.html.SafeUrl.unwrap(value).replace(/ groups.length)) { var id = groups[0].match(/\r\nContent-ID: ]*)>/)[1], status = Number(groups[1].match(/^HTTP\S*\s(\d+)\s/)[1]), text = groups.slice(2).join("\r\n\r\n"); handle(id, status, text); @@ -19388,8 +19266,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.398"; - "0.1.398" === version && (version = "latest"); + var headers = {"Content-Type":contentType}, version = "0.1.399"; + "0.1.399" === 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) { @@ -19504,7 +19382,7 @@ module$contents$ee$apiclient_apiclient.ensureAuthLibLoaded_ = function(callback) callback(); }; (function() { - goog.isObject(goog.global.default_gsi) ? done() : goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$96)).addCallback(done); + goog.isObject(goog.global.default_gsi) ? done() : goog.net.jsloader.safeLoad(module$contents$safevalues$builders$resource_url_builders_trustedResourceUrl($jscomp$templatelit$294235699$99)).addCallback(done); })(); }; module$contents$ee$apiclient_apiclient.handleAuthResult_ = function(success, error, result) { @@ -19522,8 +19400,8 @@ module$contents$ee$apiclient_apiclient.handleAuthResult_ = function(success, err } }; module$contents$ee$apiclient_apiclient.makeRequest_ = function(params) { - for (var request = new goog.Uri.QueryData(), $jscomp$iter$42 = $jscomp.makeIterator(Object.entries(params)), $jscomp$key$294235699$98$ = $jscomp$iter$42.next(); !$jscomp$key$294235699$98$.done; $jscomp$key$294235699$98$ = $jscomp$iter$42.next()) { - var $jscomp$destructuring$var47 = $jscomp.makeIterator($jscomp$key$294235699$98$.value), name = $jscomp$destructuring$var47.next().value, item = $jscomp$destructuring$var47.next().value; + for (var request = new goog.Uri.QueryData(), $jscomp$iter$42 = $jscomp.makeIterator(Object.entries(params)), $jscomp$key$294235699$101$ = $jscomp$iter$42.next(); !$jscomp$key$294235699$101$.done; $jscomp$key$294235699$101$ = $jscomp$iter$42.next()) { + var $jscomp$destructuring$var47 = $jscomp.makeIterator($jscomp$key$294235699$101$.value), name = $jscomp$destructuring$var47.next().value, item = $jscomp$destructuring$var47.next().value; request.set(name, item); } return request; @@ -24738,6 +24616,7 @@ goog.events.EventHandler.prototype.disposeInternal = function() { goog.events.EventHandler.prototype.handleEvent = function(e) { throw Error("EventHandler.handleEvent not implemented"); }; +goog.fs = {}; goog.fs.DOMErrorLike = function() { }; goog.fs.Error = function(error, action) { @@ -26955,29 +26834,29 @@ ee.data.Profiler.Format.prototype.toString = function() { ee.data.Profiler.Format.TEXT = new ee.data.Profiler.Format("text"); ee.data.Profiler.Format.JSON = new ee.data.Profiler.Format("json"); (function() { - var exportedFnInfo = {}, orderedFnNames = "ee.ApiFunction._call ee.ApiFunction.lookup ee.ApiFunction._apply ee.batch.Export.image.toCloudStorage ee.batch.Export.video.toCloudStorage ee.batch.Export.table.toFeatureView ee.batch.Export.video.toDrive ee.batch.Export.table.toDrive ee.batch.Export.table.toAsset ee.batch.Export.image.toDrive ee.batch.Export.classifier.toAsset ee.batch.Export.table.toCloudStorage ee.batch.Export.image.toAsset ee.batch.Export.map.toCloudStorage ee.batch.Export.videoMap.toCloudStorage ee.batch.Export.table.toBigQuery ee.Collection.prototype.filterBounds ee.Collection.prototype.filter ee.Collection.prototype.limit ee.Collection.prototype.sort ee.Collection.prototype.iterate ee.Collection.prototype.map ee.Collection.prototype.filterDate ee.Collection.prototype.filterMetadata ee.ComputedObject.prototype.aside ee.ComputedObject.prototype.evaluate ee.ComputedObject.prototype.getInfo ee.ComputedObject.prototype.serialize ee.data.setAssetAcl ee.data.makeThumbUrl ee.data.listAssets ee.data.renameAsset ee.data.authenticateViaOauth ee.data.getMapId ee.data.setAssetProperties ee.data.getTaskList ee.data.listBuckets ee.data.copyAsset ee.data.getTableDownloadId ee.data.makeTableDownloadUrl ee.data.authenticate ee.data.deleteAsset ee.data.getTileUrl ee.data.getTaskListWithLimit ee.data.startTableIngestion ee.data.getAssetRootQuota ee.data.listOperations ee.data.getAssetAcl ee.data.getWorkloadTag ee.data.getDownloadId ee.data.cancelOperation ee.data.listImages ee.data.makeDownloadUrl ee.data.authenticateViaPopup ee.data.getFeatureViewTilesKey ee.data.listFeatures ee.data.getAssetRoots ee.data.getAsset ee.data.createAssetHome ee.data.getOperation ee.data.setWorkloadTag ee.data.authenticateViaPrivateKey ee.data.newTaskId ee.data.getInfo ee.data.createAsset ee.data.computeValue ee.data.setDefaultWorkloadTag ee.data.getThumbId ee.data.cancelTask ee.data.resetWorkloadTag ee.data.getVideoThumbId ee.data.updateAsset ee.data.getTaskStatus ee.data.getList ee.data.updateTask ee.data.startIngestion ee.data.getFilmstripThumbId ee.data.createFolder ee.data.startProcessing ee.Date ee.Deserializer.decodeCloudApi ee.Deserializer.fromJSON ee.Deserializer.fromCloudApiJSON ee.Deserializer.decode ee.Dictionary ee.apply ee.TILE_SIZE ee.initialize ee.call ee.reset ee.Algorithms ee.InitState ee.Element.prototype.set ee.Encodable.SourceFrame ee.Feature ee.Feature.prototype.getInfo ee.Feature.prototype.getMapId ee.Feature.prototype.getMap ee.FeatureCollection.prototype.getMap ee.FeatureCollection.prototype.getDownloadURL ee.FeatureCollection.prototype.getMapId ee.FeatureCollection.prototype.getInfo ee.FeatureCollection.prototype.select ee.FeatureCollection ee.Filter.or ee.Filter.gte ee.Filter.lte ee.Filter ee.Filter.date ee.Filter.eq ee.Filter.metadata ee.Filter.gt ee.Filter.bounds ee.Filter.prototype.not ee.Filter.and ee.Filter.neq ee.Filter.inList ee.Filter.lt ee.Function.prototype.apply ee.Function.prototype.call ee.Geometry ee.Geometry.MultiPoint ee.Geometry.LineString ee.Geometry.MultiPolygon ee.Geometry.BBox ee.Geometry.Rectangle ee.Geometry.Point ee.Geometry.Polygon ee.Geometry.prototype.toGeoJSON ee.Geometry.LinearRing ee.Geometry.MultiLineString ee.Geometry.prototype.toGeoJSONString ee.Geometry.prototype.serialize ee.Image.prototype.getDownloadURL ee.Image.prototype.getThumbURL ee.Image.prototype.select ee.Image.prototype.getMap ee.Image.prototype.getThumbId ee.Image.rgb ee.Image.prototype.rename ee.Image.cat ee.Image.prototype.clip ee.Image.prototype.getMapId ee.Image ee.Image.prototype.expression ee.Image.prototype.getInfo ee.ImageCollection ee.ImageCollection.prototype.getFilmstripThumbURL ee.ImageCollection.prototype.first ee.ImageCollection.prototype.getMap ee.ImageCollection.prototype.getInfo ee.ImageCollection.prototype.select ee.ImageCollection.prototype.linkCollection ee.ImageCollection.prototype.getVideoThumbURL ee.ImageCollection.prototype.getMapId ee.List ee.Number ee.Serializer.encode ee.Serializer.encodeCloudApiPretty ee.Serializer.toJSON ee.Serializer.encodeCloudApi ee.Serializer.toCloudApiJSON ee.Serializer.toReadableJSON ee.Serializer.toReadableCloudApiJSON ee.String ee.Terrain".split(" "), - orderedParamLists = [["name", "var_args"], ["name"], ["name", "namedArgs"], "image opt_description opt_bucket opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions opt_priority".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames opt_priority".split(" "), - "collection opt_description opt_assetId opt_maxFeaturesPerTile opt_thinningStrategy opt_thinningRanking opt_zOrderRanking opt_priority".split(" "), "collection opt_description opt_folder opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames opt_priority".split(" "), "collection opt_description opt_folder opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices opt_priority".split(" "), ["collection", "opt_description", - "opt_assetId", "opt_maxVertices", "opt_priority"], "image opt_description opt_folder opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions opt_priority".split(" "), ["classifier", "opt_description", "opt_assetId", "opt_priority"], "collection opt_description opt_bucket opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices opt_priority".split(" "), "image opt_description opt_assetId opt_pyramidingPolicy opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_priority".split(" "), - "image opt_description opt_bucket opt_fileFormat opt_path opt_writePublicTiles opt_scale opt_maxZoom opt_minZoom opt_region opt_skipEmptyTiles opt_mapsApiKey opt_bucketCorsUris opt_priority".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_writePublicTiles opt_minZoom opt_maxZoom opt_scale opt_region opt_skipEmptyTiles opt_minTimeMachineZoomSubset opt_maxTimeMachineZoomSubset opt_tileWidth opt_tileHeight opt_tileStride opt_videoFormat opt_version opt_mapsApiKey opt_bucketCorsUris opt_priority".split(" "), - "collection opt_description opt_table opt_overwrite opt_append opt_selectors opt_maxVertices opt_priority".split(" "), ["geometry"], ["filter"], ["max", "opt_property", "opt_ascending"], ["property", "opt_ascending"], ["algorithm", "opt_first"], ["algorithm", "opt_dropNulls"], ["start", "opt_end"], ["name", "operator", "value"], ["func", "var_args"], ["callback"], ["opt_callback"], ["legacy"], ["assetId", "aclUpdate", "opt_callback"], ["id"], ["parent", "opt_params", "opt_callback"], ["sourceId", - "destinationId", "opt_callback"], "clientId success opt_error opt_extraScopes opt_onImmediateFailed opt_suppressDefaultScopes".split(" "), ["params", "opt_callback"], ["assetId", "properties", "opt_callback"], ["opt_callback"], ["project", "opt_callback"], ["sourceId", "destinationId", "opt_overwrite", "opt_callback"], ["params", "opt_callback"], ["id"], ["clientId", "success", "opt_error", "opt_extraScopes", "opt_onImmediateFailed"], ["assetId", "opt_callback"], ["id", "x", "y", "z"], ["opt_limit", - "opt_callback"], ["taskId", "request", "opt_callback"], ["rootId", "opt_callback"], ["opt_limit", "opt_callback"], ["assetId", "opt_callback"], [], ["params", "opt_callback"], ["operationName", "opt_callback"], ["parent", "opt_params", "opt_callback"], ["id"], ["opt_success", "opt_error"], ["params", "opt_callback"], ["asset", "params", "opt_callback"], ["opt_callback"], ["id", "opt_callback"], ["requestedId", "opt_callback"], ["operationName", "opt_callback"], ["tag"], ["privateKey", "opt_success", - "opt_error", "opt_extraScopes", "opt_suppressDefaultScopes"], ["opt_count", "opt_callback"], ["id", "opt_callback"], ["value", "opt_path", "opt_force", "opt_properties", "opt_callback"], ["obj", "opt_callback"], ["tag"], ["params", "opt_callback"], ["taskId", "opt_callback"], ["opt_resetDefault"], ["params", "opt_callback"], ["assetId", "asset", "updateFields", "opt_callback"], ["taskId", "opt_callback"], ["params", "opt_callback"], ["taskId", "action", "opt_callback"], ["taskId", "request", "opt_callback"], - ["params", "opt_callback"], ["path", "opt_force", "opt_callback"], ["taskId", "params", "opt_callback"], ["date", "opt_tz"], ["json"], ["json"], ["json"], ["json"], ["opt_dict"], ["func", "namedArgs"], [], "opt_baseurl opt_tileurl opt_successCallback opt_errorCallback opt_xsrfToken opt_project".split(" "), ["func", "var_args"], [], [], [], ["var_args"], [], ["geometry", "opt_properties"], ["opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], - ["opt_format", "opt_selectors", "opt_filename", "opt_callback"], ["opt_visParams", "opt_callback"], ["opt_callback"], ["propertySelectors", "opt_newProperties", "opt_retainGeometry"], ["args", "opt_column"], ["var_args"], ["name", "value"], ["name", "value"], ["opt_filter"], ["start", "opt_end"], ["name", "value"], ["name", "operator", "value"], ["name", "value"], ["geometry", "opt_errorMargin"], [], ["var_args"], ["name", "value"], ["opt_leftField", "opt_rightValue", "opt_rightField", "opt_leftValue"], - ["name", "value"], ["namedArgs"], ["var_args"], ["geoJson", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["coords", "opt_proj"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], ["west", "south", "east", "north"], ["coords", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["coords", "opt_proj"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], [], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], - ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], [], ["legacy"], ["params", "opt_callback"], ["params", "opt_callback"], ["var_args"], ["opt_visParams", "opt_callback"], ["params", "opt_callback"], ["r", "g", "b"], ["var_args"], ["var_args"], ["geometry"], ["opt_visParams", "opt_callback"], ["opt_args"], ["expression", "opt_map"], ["opt_callback"], ["args"], ["params", "opt_callback"], [], ["opt_visParams", "opt_callback"], ["opt_callback"], ["selectors", "opt_names"], ["imageCollection", - "opt_linkedBands", "opt_linkedProperties", "opt_matchPropertyName"], ["params", "opt_callback"], ["opt_visParams", "opt_callback"], ["list"], ["number"], ["obj", "opt_isCompound"], ["obj"], ["obj"], ["obj"], ["obj"], ["obj"], ["obj"], ["string"], []]; - [ee.ApiFunction._call, ee.ApiFunction.lookup, ee.ApiFunction._apply, module$contents$ee$batch_Export.image.toCloudStorage, module$contents$ee$batch_Export.video.toCloudStorage, module$contents$ee$batch_Export.table.toFeatureView, module$contents$ee$batch_Export.video.toDrive, module$contents$ee$batch_Export.table.toDrive, module$contents$ee$batch_Export.table.toAsset, module$contents$ee$batch_Export.image.toDrive, module$contents$ee$batch_Export.classifier.toAsset, module$contents$ee$batch_Export.table.toCloudStorage, - module$contents$ee$batch_Export.image.toAsset, module$contents$ee$batch_Export.map.toCloudStorage, module$contents$ee$batch_Export.videoMap.toCloudStorage, module$contents$ee$batch_Export.table.toBigQuery, ee.Collection.prototype.filterBounds, ee.Collection.prototype.filter, ee.Collection.prototype.limit, ee.Collection.prototype.sort, ee.Collection.prototype.iterate, ee.Collection.prototype.map, ee.Collection.prototype.filterDate, ee.Collection.prototype.filterMetadata, ee.ComputedObject.prototype.aside, - ee.ComputedObject.prototype.evaluate, ee.ComputedObject.prototype.getInfo, ee.ComputedObject.prototype.serialize, ee.data.setAssetAcl, ee.data.makeThumbUrl, ee.data.listAssets, ee.data.renameAsset, ee.data.authenticateViaOauth, ee.data.getMapId, ee.data.setAssetProperties, ee.data.getTaskList, ee.data.listBuckets, ee.data.copyAsset, ee.data.getTableDownloadId, ee.data.makeTableDownloadUrl, ee.data.authenticate, ee.data.deleteAsset, ee.data.getTileUrl, ee.data.getTaskListWithLimit, ee.data.startTableIngestion, - ee.data.getAssetRootQuota, ee.data.listOperations, ee.data.getAssetAcl, ee.data.getWorkloadTag, ee.data.getDownloadId, ee.data.cancelOperation, ee.data.listImages, ee.data.makeDownloadUrl, ee.data.authenticateViaPopup, ee.data.getFeatureViewTilesKey, ee.data.listFeatures, ee.data.getAssetRoots, ee.data.getAsset, ee.data.createAssetHome, ee.data.getOperation, ee.data.setWorkloadTag, ee.data.authenticateViaPrivateKey, ee.data.newTaskId, ee.data.getInfo, ee.data.createAsset, ee.data.computeValue, - ee.data.setDefaultWorkloadTag, ee.data.getThumbId, ee.data.cancelTask, ee.data.resetWorkloadTag, ee.data.getVideoThumbId, ee.data.updateAsset, ee.data.getTaskStatus, ee.data.getList, ee.data.updateTask, ee.data.startIngestion, ee.data.getFilmstripThumbId, ee.data.createFolder, ee.data.startProcessing, ee.Date, ee.Deserializer.decodeCloudApi, ee.Deserializer.fromJSON, ee.Deserializer.fromCloudApiJSON, ee.Deserializer.decode, ee.Dictionary, ee.apply, ee.TILE_SIZE, ee.initialize, ee.call, ee.reset, - ee.Algorithms, ee.InitState, ee.Element.prototype.set, ee.Encodable.SourceFrame, ee.Feature, ee.Feature.prototype.getInfo, ee.Feature.prototype.getMapId, ee.Feature.prototype.getMap, ee.FeatureCollection.prototype.getMap, ee.FeatureCollection.prototype.getDownloadURL, ee.FeatureCollection.prototype.getMapId, ee.FeatureCollection.prototype.getInfo, ee.FeatureCollection.prototype.select, ee.FeatureCollection, ee.Filter.or, ee.Filter.gte, ee.Filter.lte, ee.Filter, ee.Filter.date, ee.Filter.eq, ee.Filter.metadata, - ee.Filter.gt, ee.Filter.bounds, ee.Filter.prototype.not, ee.Filter.and, ee.Filter.neq, ee.Filter.inList, ee.Filter.lt, ee.Function.prototype.apply, ee.Function.prototype.call, ee.Geometry, ee.Geometry.MultiPoint, ee.Geometry.LineString, ee.Geometry.MultiPolygon, ee.Geometry.BBox, ee.Geometry.Rectangle, ee.Geometry.Point, ee.Geometry.Polygon, ee.Geometry.prototype.toGeoJSON, ee.Geometry.LinearRing, ee.Geometry.MultiLineString, ee.Geometry.prototype.toGeoJSONString, ee.Geometry.prototype.serialize, - ee.Image.prototype.getDownloadURL, ee.Image.prototype.getThumbURL, ee.Image.prototype.select, ee.Image.prototype.getMap, ee.Image.prototype.getThumbId, ee.Image.rgb, ee.Image.prototype.rename, ee.Image.cat, ee.Image.prototype.clip, ee.Image.prototype.getMapId, ee.Image, ee.Image.prototype.expression, ee.Image.prototype.getInfo, ee.ImageCollection, ee.ImageCollection.prototype.getFilmstripThumbURL, ee.ImageCollection.prototype.first, ee.ImageCollection.prototype.getMap, ee.ImageCollection.prototype.getInfo, - ee.ImageCollection.prototype.select, ee.ImageCollection.prototype.linkCollection, ee.ImageCollection.prototype.getVideoThumbURL, ee.ImageCollection.prototype.getMapId, ee.List, ee.Number, ee.Serializer.encode, ee.Serializer.encodeCloudApiPretty, ee.Serializer.toJSON, ee.Serializer.encodeCloudApi, ee.Serializer.toCloudApiJSON, ee.Serializer.toReadableJSON, ee.Serializer.toReadableCloudApiJSON, ee.String, ee.Terrain].forEach(function(fn, i) { + var exportedFnInfo = {}, orderedFnNames = "ee.ApiFunction._call ee.ApiFunction.lookup ee.ApiFunction._apply ee.batch.Export.table.toAsset ee.batch.Export.image.toDrive ee.batch.Export.table.toCloudStorage ee.batch.Export.classifier.toAsset ee.batch.Export.image.toAsset ee.batch.Export.map.toCloudStorage ee.batch.Export.videoMap.toCloudStorage ee.batch.Export.table.toBigQuery ee.batch.Export.image.toCloudStorage ee.batch.Export.video.toCloudStorage ee.batch.Export.table.toFeatureView ee.batch.Export.video.toDrive ee.batch.Export.table.toDrive ee.Collection.prototype.map ee.Collection.prototype.iterate ee.Collection.prototype.filterBounds ee.Collection.prototype.filterMetadata ee.Collection.prototype.filterDate ee.Collection.prototype.sort ee.Collection.prototype.limit ee.Collection.prototype.filter ee.ComputedObject.prototype.serialize ee.ComputedObject.prototype.aside ee.ComputedObject.prototype.evaluate ee.ComputedObject.prototype.getInfo ee.data.authenticateViaPrivateKey ee.data.newTaskId ee.data.updateAsset ee.data.computeValue ee.data.cancelTask ee.data.getList ee.data.getThumbId ee.data.createFolder ee.data.startIngestion ee.data.setAssetAcl ee.data.getVideoThumbId ee.data.updateTask ee.data.getTaskStatus ee.data.renameAsset ee.data.listBuckets ee.data.getFilmstripThumbId ee.data.startProcessing ee.data.listAssets ee.data.makeThumbUrl ee.data.getMapId ee.data.setAssetProperties ee.data.authenticateViaOauth ee.data.copyAsset ee.data.deleteAsset ee.data.getAssetRootQuota ee.data.getTaskList ee.data.startTableIngestion ee.data.getOperation ee.data.authenticate ee.data.getTileUrl ee.data.getTableDownloadId ee.data.setWorkloadTag ee.data.getAssetAcl ee.data.getWorkloadTag ee.data.getTaskListWithLimit ee.data.listImages ee.data.makeTableDownloadUrl ee.data.listOperations ee.data.getAssetRoots ee.data.getDownloadId ee.data.getAsset ee.data.cancelOperation ee.data.authenticateViaPopup ee.data.makeDownloadUrl ee.data.getFeatureViewTilesKey ee.data.createAssetHome ee.data.listFeatures ee.data.getInfo ee.data.createAsset ee.data.setDefaultWorkloadTag ee.data.resetWorkloadTag ee.Date ee.Deserializer.decode ee.Deserializer.decodeCloudApi ee.Deserializer.fromJSON ee.Deserializer.fromCloudApiJSON ee.Dictionary ee.Algorithms ee.InitState ee.apply ee.TILE_SIZE ee.initialize ee.reset ee.call ee.Element.prototype.set ee.Encodable.SourceFrame ee.Feature ee.Feature.prototype.getInfo ee.Feature.prototype.getMapId ee.Feature.prototype.getMap ee.FeatureCollection.prototype.getInfo ee.FeatureCollection.prototype.getDownloadURL ee.FeatureCollection ee.FeatureCollection.prototype.getMap ee.FeatureCollection.prototype.select ee.FeatureCollection.prototype.getMapId ee.Filter ee.Filter.metadata ee.Filter.eq ee.Filter.date ee.Filter.bounds ee.Filter.and ee.Filter.gt ee.Filter.inList ee.Filter.prototype.not ee.Filter.lt ee.Filter.neq ee.Filter.or ee.Filter.lte ee.Filter.gte ee.Function.prototype.call ee.Function.prototype.apply ee.Geometry.Polygon ee.Geometry.MultiPolygon ee.Geometry.prototype.serialize ee.Geometry.MultiLineString ee.Geometry.prototype.toGeoJSON ee.Geometry ee.Geometry.MultiPoint ee.Geometry.BBox ee.Geometry.Rectangle ee.Geometry.prototype.toGeoJSONString ee.Geometry.LinearRing ee.Geometry.LineString ee.Geometry.Point ee.Image.prototype.getMapId ee.Image.prototype.getMap ee.Image.prototype.getDownloadURL ee.Image.prototype.expression ee.Image.prototype.rename ee.Image.prototype.getThumbId ee.Image.prototype.getThumbURL ee.Image ee.Image.rgb ee.Image.cat ee.Image.prototype.select ee.Image.prototype.clip ee.Image.prototype.getInfo ee.ImageCollection.prototype.linkCollection ee.ImageCollection.prototype.first ee.ImageCollection ee.ImageCollection.prototype.getInfo ee.ImageCollection.prototype.select ee.ImageCollection.prototype.getVideoThumbURL ee.ImageCollection.prototype.getMap ee.ImageCollection.prototype.getMapId ee.ImageCollection.prototype.getFilmstripThumbURL ee.List ee.Number ee.Serializer.toReadableJSON ee.Serializer.toReadableCloudApiJSON ee.Serializer.encodeCloudApiPretty ee.Serializer.encodeCloudApi ee.Serializer.encode ee.Serializer.toJSON ee.Serializer.toCloudApiJSON ee.String ee.Terrain".split(" "), + orderedParamLists = [["name", "var_args"], ["name"], ["name", "namedArgs"], ["collection", "opt_description", "opt_assetId", "opt_maxVertices", "opt_priority"], "image opt_description opt_folder opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions opt_priority".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices opt_priority".split(" "), + ["classifier", "opt_description", "opt_assetId", "opt_priority"], "image opt_description opt_assetId opt_pyramidingPolicy opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_priority".split(" "), "image opt_description opt_bucket opt_fileFormat opt_path opt_writePublicTiles opt_scale opt_maxZoom opt_minZoom opt_region opt_skipEmptyTiles opt_mapsApiKey opt_bucketCorsUris opt_priority".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_writePublicTiles opt_minZoom opt_maxZoom opt_scale opt_region opt_skipEmptyTiles opt_minTimeMachineZoomSubset opt_maxTimeMachineZoomSubset opt_tileWidth opt_tileHeight opt_tileStride opt_videoFormat opt_version opt_mapsApiKey opt_bucketCorsUris opt_priority".split(" "), + "collection opt_description opt_table opt_overwrite opt_append opt_selectors opt_maxVertices opt_priority".split(" "), "image opt_description opt_bucket opt_fileNamePrefix opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_shardSize opt_fileDimensions opt_skipEmptyTiles opt_fileFormat opt_formatOptions opt_priority".split(" "), "collection opt_description opt_bucket opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames opt_priority".split(" "), + "collection opt_description opt_assetId opt_maxFeaturesPerTile opt_thinningStrategy opt_thinningRanking opt_zOrderRanking opt_priority".split(" "), "collection opt_description opt_folder opt_fileNamePrefix opt_framesPerSecond opt_dimensions opt_region opt_scale opt_crs opt_crsTransform opt_maxPixels opt_maxFrames opt_priority".split(" "), "collection opt_description opt_folder opt_fileNamePrefix opt_fileFormat opt_selectors opt_maxVertices opt_priority".split(" "), ["algorithm", "opt_dropNulls"], + ["algorithm", "opt_first"], ["geometry"], ["name", "operator", "value"], ["start", "opt_end"], ["property", "opt_ascending"], ["max", "opt_property", "opt_ascending"], ["filter"], ["legacy"], ["func", "var_args"], ["callback"], ["opt_callback"], ["privateKey", "opt_success", "opt_error", "opt_extraScopes", "opt_suppressDefaultScopes"], ["opt_count", "opt_callback"], ["assetId", "asset", "updateFields", "opt_callback"], ["obj", "opt_callback"], ["taskId", "opt_callback"], ["params", "opt_callback"], + ["params", "opt_callback"], ["path", "opt_force", "opt_callback"], ["taskId", "request", "opt_callback"], ["assetId", "aclUpdate", "opt_callback"], ["params", "opt_callback"], ["taskId", "action", "opt_callback"], ["taskId", "opt_callback"], ["sourceId", "destinationId", "opt_callback"], ["project", "opt_callback"], ["params", "opt_callback"], ["taskId", "params", "opt_callback"], ["parent", "opt_params", "opt_callback"], ["id"], ["params", "opt_callback"], ["assetId", "properties", "opt_callback"], + "clientId success opt_error opt_extraScopes opt_onImmediateFailed opt_suppressDefaultScopes".split(" "), ["sourceId", "destinationId", "opt_overwrite", "opt_callback"], ["assetId", "opt_callback"], ["rootId", "opt_callback"], ["opt_callback"], ["taskId", "request", "opt_callback"], ["operationName", "opt_callback"], ["clientId", "success", "opt_error", "opt_extraScopes", "opt_onImmediateFailed"], ["id", "x", "y", "z"], ["params", "opt_callback"], ["tag"], ["assetId", "opt_callback"], [], ["opt_limit", + "opt_callback"], ["parent", "opt_params", "opt_callback"], ["id"], ["opt_limit", "opt_callback"], ["opt_callback"], ["params", "opt_callback"], ["id", "opt_callback"], ["operationName", "opt_callback"], ["opt_success", "opt_error"], ["id"], ["params", "opt_callback"], ["requestedId", "opt_callback"], ["asset", "params", "opt_callback"], ["id", "opt_callback"], ["value", "opt_path", "opt_force", "opt_properties", "opt_callback"], ["tag"], ["opt_resetDefault"], ["date", "opt_tz"], ["json"], ["json"], + ["json"], ["json"], ["opt_dict"], [], [], ["func", "namedArgs"], [], "opt_baseurl opt_tileurl opt_successCallback opt_errorCallback opt_xsrfToken opt_project".split(" "), [], ["func", "var_args"], ["var_args"], [], ["geometry", "opt_properties"], ["opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], ["opt_callback"], ["opt_format", "opt_selectors", "opt_filename", "opt_callback"], ["args", "opt_column"], ["opt_visParams", "opt_callback"], ["propertySelectors", + "opt_newProperties", "opt_retainGeometry"], ["opt_visParams", "opt_callback"], ["opt_filter"], ["name", "operator", "value"], ["name", "value"], ["start", "opt_end"], ["geometry", "opt_errorMargin"], ["var_args"], ["name", "value"], ["opt_leftField", "opt_rightValue", "opt_rightField", "opt_leftValue"], [], ["name", "value"], ["name", "value"], ["var_args"], ["name", "value"], ["name", "value"], ["var_args"], ["namedArgs"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], + ["coords", "opt_proj", "opt_geodesic", "opt_maxError", "opt_evenOdd"], ["legacy"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], [], ["geoJson", "opt_proj", "opt_geodesic", "opt_evenOdd"], ["coords", "opt_proj"], ["west", "south", "east", "north"], ["coords", "opt_proj", "opt_geodesic", "opt_evenOdd"], [], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], ["coords", "opt_proj", "opt_geodesic", "opt_maxError"], ["coords", "opt_proj"], ["opt_visParams", "opt_callback"], ["opt_visParams", + "opt_callback"], ["params", "opt_callback"], ["expression", "opt_map"], ["var_args"], ["params", "opt_callback"], ["params", "opt_callback"], ["opt_args"], ["r", "g", "b"], ["var_args"], ["var_args"], ["geometry"], ["opt_callback"], ["imageCollection", "opt_linkedBands", "opt_linkedProperties", "opt_matchPropertyName"], [], ["args"], ["opt_callback"], ["selectors", "opt_names"], ["params", "opt_callback"], ["opt_visParams", "opt_callback"], ["opt_visParams", "opt_callback"], ["params", "opt_callback"], + ["list"], ["number"], ["obj"], ["obj"], ["obj"], ["obj"], ["obj", "opt_isCompound"], ["obj"], ["obj"], ["string"], []]; + [ee.ApiFunction._call, ee.ApiFunction.lookup, ee.ApiFunction._apply, module$contents$ee$batch_Export.table.toAsset, module$contents$ee$batch_Export.image.toDrive, module$contents$ee$batch_Export.table.toCloudStorage, module$contents$ee$batch_Export.classifier.toAsset, module$contents$ee$batch_Export.image.toAsset, module$contents$ee$batch_Export.map.toCloudStorage, module$contents$ee$batch_Export.videoMap.toCloudStorage, module$contents$ee$batch_Export.table.toBigQuery, module$contents$ee$batch_Export.image.toCloudStorage, + module$contents$ee$batch_Export.video.toCloudStorage, module$contents$ee$batch_Export.table.toFeatureView, module$contents$ee$batch_Export.video.toDrive, module$contents$ee$batch_Export.table.toDrive, ee.Collection.prototype.map, ee.Collection.prototype.iterate, ee.Collection.prototype.filterBounds, ee.Collection.prototype.filterMetadata, ee.Collection.prototype.filterDate, ee.Collection.prototype.sort, ee.Collection.prototype.limit, ee.Collection.prototype.filter, ee.ComputedObject.prototype.serialize, + ee.ComputedObject.prototype.aside, ee.ComputedObject.prototype.evaluate, ee.ComputedObject.prototype.getInfo, ee.data.authenticateViaPrivateKey, ee.data.newTaskId, ee.data.updateAsset, ee.data.computeValue, ee.data.cancelTask, ee.data.getList, ee.data.getThumbId, ee.data.createFolder, ee.data.startIngestion, ee.data.setAssetAcl, ee.data.getVideoThumbId, ee.data.updateTask, ee.data.getTaskStatus, ee.data.renameAsset, ee.data.listBuckets, ee.data.getFilmstripThumbId, ee.data.startProcessing, ee.data.listAssets, + ee.data.makeThumbUrl, ee.data.getMapId, ee.data.setAssetProperties, ee.data.authenticateViaOauth, ee.data.copyAsset, ee.data.deleteAsset, ee.data.getAssetRootQuota, ee.data.getTaskList, ee.data.startTableIngestion, ee.data.getOperation, ee.data.authenticate, ee.data.getTileUrl, ee.data.getTableDownloadId, ee.data.setWorkloadTag, ee.data.getAssetAcl, ee.data.getWorkloadTag, ee.data.getTaskListWithLimit, ee.data.listImages, ee.data.makeTableDownloadUrl, ee.data.listOperations, ee.data.getAssetRoots, + ee.data.getDownloadId, ee.data.getAsset, ee.data.cancelOperation, ee.data.authenticateViaPopup, ee.data.makeDownloadUrl, ee.data.getFeatureViewTilesKey, ee.data.createAssetHome, ee.data.listFeatures, ee.data.getInfo, ee.data.createAsset, ee.data.setDefaultWorkloadTag, ee.data.resetWorkloadTag, ee.Date, ee.Deserializer.decode, ee.Deserializer.decodeCloudApi, ee.Deserializer.fromJSON, ee.Deserializer.fromCloudApiJSON, ee.Dictionary, ee.Algorithms, ee.InitState, ee.apply, ee.TILE_SIZE, ee.initialize, + ee.reset, ee.call, ee.Element.prototype.set, ee.Encodable.SourceFrame, ee.Feature, ee.Feature.prototype.getInfo, ee.Feature.prototype.getMapId, ee.Feature.prototype.getMap, ee.FeatureCollection.prototype.getInfo, ee.FeatureCollection.prototype.getDownloadURL, ee.FeatureCollection, ee.FeatureCollection.prototype.getMap, ee.FeatureCollection.prototype.select, ee.FeatureCollection.prototype.getMapId, ee.Filter, ee.Filter.metadata, ee.Filter.eq, ee.Filter.date, ee.Filter.bounds, ee.Filter.and, ee.Filter.gt, + ee.Filter.inList, ee.Filter.prototype.not, ee.Filter.lt, ee.Filter.neq, ee.Filter.or, ee.Filter.lte, ee.Filter.gte, ee.Function.prototype.call, ee.Function.prototype.apply, ee.Geometry.Polygon, ee.Geometry.MultiPolygon, ee.Geometry.prototype.serialize, ee.Geometry.MultiLineString, ee.Geometry.prototype.toGeoJSON, ee.Geometry, ee.Geometry.MultiPoint, ee.Geometry.BBox, ee.Geometry.Rectangle, ee.Geometry.prototype.toGeoJSONString, ee.Geometry.LinearRing, ee.Geometry.LineString, ee.Geometry.Point, + ee.Image.prototype.getMapId, ee.Image.prototype.getMap, ee.Image.prototype.getDownloadURL, ee.Image.prototype.expression, ee.Image.prototype.rename, ee.Image.prototype.getThumbId, ee.Image.prototype.getThumbURL, ee.Image, ee.Image.rgb, ee.Image.cat, ee.Image.prototype.select, ee.Image.prototype.clip, ee.Image.prototype.getInfo, ee.ImageCollection.prototype.linkCollection, ee.ImageCollection.prototype.first, ee.ImageCollection, ee.ImageCollection.prototype.getInfo, ee.ImageCollection.prototype.select, + ee.ImageCollection.prototype.getVideoThumbURL, ee.ImageCollection.prototype.getMap, ee.ImageCollection.prototype.getMapId, ee.ImageCollection.prototype.getFilmstripThumbURL, ee.List, ee.Number, ee.Serializer.toReadableJSON, ee.Serializer.toReadableCloudApiJSON, ee.Serializer.encodeCloudApiPretty, ee.Serializer.encodeCloudApi, ee.Serializer.encode, ee.Serializer.toJSON, ee.Serializer.toCloudApiJSON, ee.String, ee.Terrain].forEach(function(fn, i) { fn && (exportedFnInfo[fn.toString()] = {name:orderedFnNames[i], paramNames:orderedParamLists[i]}); }); goog.global.EXPORTED_FN_INFO = exportedFnInfo; diff --git a/javascript/package.json b/javascript/package.json index a18b6f84e..835a52575 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -1,6 +1,6 @@ { "name": "@google/earthengine", - "version": "0.1.398", + "version": "0.1.399", "description": "JavaScript client for Google Earth Engine API.", "author": "Google LLC", "license": "Apache-2.0", diff --git a/javascript/src/apiclient.js b/javascript/src/apiclient.js index 1eed412a2..114f26a8b 100644 --- a/javascript/src/apiclient.js +++ b/javascript/src/apiclient.js @@ -24,7 +24,7 @@ const {trustedResourceUrl} = goog.require('safevalues'); /** @namespace */ const apiclient = {}; -const API_CLIENT_VERSION = '0.1.398'; +const API_CLIENT_VERSION = '0.1.399'; exports.VERSION = apiVersion.VERSION; exports.API_CLIENT_VERSION = API_CLIENT_VERSION; diff --git a/javascript/src/eeapiclient/promise_request_service.ts b/javascript/src/eeapiclient/promise_request_service.ts index 56ed0939e..bfbc03f52 100644 --- a/javascript/src/eeapiclient/promise_request_service.ts +++ b/javascript/src/eeapiclient/promise_request_service.ts @@ -19,5 +19,5 @@ export abstract class PromiseRequestService { ); } - abstract makeRequest(params: MakeRequestParams): Promise<{}>; + abstract makeRequest(params: MakeRequestParams): Promise; } diff --git a/javascript/src/geometry.js b/javascript/src/geometry.js index 4ca66731d..e8d790ece 100644 --- a/javascript/src/geometry.js +++ b/javascript/src/geometry.js @@ -112,7 +112,7 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) { /** * The coordinates of the geometry, up to 4 nested levels with numbers at - * the last level. Null iff type is GeometryCollection. + * the last level. Null if and only if type is GeometryCollection. * @type {Array?} * @private */ @@ -121,7 +121,7 @@ ee.Geometry = function(geoJson, opt_proj, opt_geodesic, opt_evenOdd) { null; /** - * The subgeometries, non-null iff type is GeometryCollection. + * The subgeometries, non-null if and only if type is GeometryCollection. * @type {Array?} * @private */ diff --git a/javascript/src/profiler.js b/javascript/src/profiler.js index 7fd3193b0..f445cdf13 100644 --- a/javascript/src/profiler.js +++ b/javascript/src/profiler.js @@ -46,7 +46,8 @@ ee.data.Profiler = class extends goog.events.EventTarget { this.isEnabled_ = false; /** - * Non-null unique object iff we have a refresh request outstanding. + * Non-null unique object if and only if we have a refresh request + * outstanding. * @private {?Object} */ this.lastRefreshToken_ = null; diff --git a/python/ee/__init__.py b/python/ee/__init__.py index 2c50741ca..7fb7bc568 100644 --- a/python/ee/__init__.py +++ b/python/ee/__init__.py @@ -1,6 +1,6 @@ """The EE Python library.""" -__version__ = '0.1.398' +__version__ = '0.1.399' # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name diff --git a/python/ee/data.py b/python/ee/data.py index fcd5c4933..10ed26ab6 100644 --- a/python/ee/data.py +++ b/python/ee/data.py @@ -558,7 +558,7 @@ def getList(params: Dict[str, Any]) -> Any: def listImages( params: Union[str, Dict[str, Any]], -) -> Dict[str, Optional[List[int]]]: +) -> Dict[str, Optional[List[Any]]]: """Returns the images in an image collection or folder. Args: @@ -1927,6 +1927,7 @@ def startIngestion( 'overwrite': allow_overwrite } + # It's only safe to retry the request if there's a unique ID to make it # idempotent. num_retries = MAX_RETRIES if request_id else 0 diff --git a/python/ee/ee_number.py b/python/ee/ee_number.py index 648ded25a..3dc1eacbd 100644 --- a/python/ee/ee_number.py +++ b/python/ee/ee_number.py @@ -74,3 +74,210 @@ def encode_cloud_value(self, encoder: Any = None) -> Any: return _cloud_api_utils.encode_number_as_cloud_value(self._number) else: return super().encode_cloud_value(encoder) + + def abs(self) -> 'Number': + """Computes the absolute value of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.abs', self) + + def acos(self) -> 'Number': + """Computes the arccosine in radians of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.acos', self) + + def add(self, right: _NumberType) -> 'Number': + """Adds the right value. + + Args: + right: The value to add to the current ee.Number. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_(self.name() + '.add', self, right) + + # `and` is not allowed by the Python parser. + def And(self, right: _NumberType) -> 'Number': + """Returns 1 if and only if both values are non-zero. + + Args: + right: The value to and with the current ee.Number. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_(self.name() + '.and', self, right) + + def asin(self) -> 'Number': + """Computes the arcsine in radians of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.asin', self) + + def atan(self) -> 'Number': + """Computes the arctangent in radians of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.atan', self) + + def atan2(self, right: _NumberType) -> 'Number': + """Calculates the angle in radians formed by the 2D vector [x, y]. + + Args: + right: The second value of the atan2 call. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_(self.name() + '.atan2', self, right) + + def bitCount(self) -> 'Number': + """Returns the number of one-bits in the Number. + + Calculates the number of one-bits in the 64-bit two's complement binary + representation of the input. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_(self.name() + '.bitCount', self) + + def bitwiseAnd(self, right: _NumberType) -> 'Number': + """Calculates the bitwise AND of the input values. + + Args: + right: The value to do the bitwise AND with. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_( + self.name() + '.bitwiseAnd', self, right + ) + + def bitwiseNot(self) -> 'Number': + """Returns the bitwise NOT of the input. + + Uses the smallest signed integer type that can hold the input. + """ + + return apifunction.ApiFunction.call_(self.name() + '.bitwiseNot', self) + + def bitwiseOr(self, right: _NumberType) -> 'Number': + """Calculates the bitwise OR of the input values. + + Args: + right: The value to OR with. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_( + self.name() + '.bitwiseOr', self, right + ) + + def bitwiseXor(self, right: _NumberType) -> 'Number': + """Calculates the bitwise XOR of the input values. + + Args: + right: The right-hand value. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_( + self.name() + '.bitwiseXor', self, right + ) + + def byte(self) -> 'Number': + """Casts the input value to an unsigned 8-bit integer.""" + + return apifunction.ApiFunction.call_(self.name() + '.byte', self) + + def cbrt(self) -> 'Number': + """Computes the cubic root of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.cbrt', self) + + def ceil(self) -> 'Number': + """Computes the smallest integer greater than or equal to the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.ceil', self) + + # TODO: Add clamp method with `min` and `max` args. + + def cos(self) -> 'Number': + """Computes the cosine of the input in radians.""" + + return apifunction.ApiFunction.call_(self.name() + '.cos', self) + + def cosh(self) -> 'Number': + """Computes the hyperbolic cosine of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.cosh', self) + + def digamma(self) -> 'Number': + """Computes the digamma function of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.digamma', self) + + def divide(self, right: _NumberType) -> 'Number': + """Divides the first value by the second, returning 0 for division by 0. + + Args: + right: The value to divide by. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_(self.name() + '.divide', self, right) + + def double(self) -> 'Number': + """Casts the input value to a 64-bit float.""" + + return apifunction.ApiFunction.call_(self.name() + '.double', self) + + def eq(self, right: _NumberType) -> 'Number': + """Returns 1 if and only if the first value is equal to the second. + + Args: + right: The value to compare to. + + Returns: + An ee.Number. + """ + + return apifunction.ApiFunction.call_(self.name() + '.eq', self, right) + + def erf(self) -> 'Number': + """Computes the error function of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.erf', self) + + def erfInv(self) -> 'Number': + """Computes the inverse error function of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.erfInv', self) + + def erfc(self) -> 'Number': + """Computes the complementary error function of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.erfc', self) + + def erfcInv(self) -> 'Number': + """Computes the inverse complementary error function of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.erfcInv', self) + + def exp(self) -> 'Number': + """Computes the Euler's number e raised to the power of the input.""" + + return apifunction.ApiFunction.call_(self.name() + '.exp', self) + + # TODO: Add expression staticmethod diff --git a/python/ee/filter.py b/python/ee/filter.py index 6ac130b05..825286ff2 100644 --- a/python/ee/filter.py +++ b/python/ee/filter.py @@ -128,7 +128,7 @@ def Not(self): """Returns the opposite of this filter. Returns: - The negated filter, which will match iff this filter doesn't. + The negated filter, which will match if and only if this filter does not. """ return apifunction.ApiFunction.call_('Filter.not', self) diff --git a/python/ee/geometry.py b/python/ee/geometry.py index ea9e13c90..12815e565 100644 --- a/python/ee/geometry.py +++ b/python/ee/geometry.py @@ -89,7 +89,7 @@ def __init__( self._type = geo_json['type'] # The coordinates of the geometry, up to 4 nested levels with numbers at - # the last level. None iff type is GeometryCollection. + # the last level. None if and only if type is GeometryCollection. self._coordinates = geo_json.get('coordinates') # The subgeometries, None unless type is GeometryCollection. diff --git a/python/ee/tests/algorithms.json b/python/ee/tests/algorithms.json index 2cd379f98..06bfe661c 100644 --- a/python/ee/tests/algorithms.json +++ b/python/ee/tests/algorithms.json @@ -11071,7 +11071,7 @@ }] }, { "name": "algorithms/reduce.and", - "description": "Reduces an image collection by setting each pixel to 1 iff all the non-masked values at that pixel are non-zero across the stack of all matching bands. Bands are matched by name.", + "description": "Reduces an image collection by setting each pixel to 1 if and only if all the non-masked values at that pixel are non-zero across the stack of all matching bands. Bands are matched by name.", "returnType": "Image\u003cunknown bands\u003e", "arguments": [{ "argumentName": "collection", @@ -11080,7 +11080,7 @@ }] }, { "name": "algorithms/reduce.or", - "description": "Reduces an image collection by setting each pixel to 1 iff any of the non-masked values at that pixel are non-zero across the stack of all matching bands. Bands are matched by name.", + "description": "Reduces an image collection by setting each pixel to 1 if and only if any of the non-masked values at that pixel are non-zero across the stack of all matching bands. Bands are matched by name.", "returnType": "Image\u003cunknown bands\u003e", "arguments": [{ "argumentName": "collection", @@ -11626,9 +11626,7 @@ "type": "Dictionary\u003cObject\u003e" }, { "argumentName": "key", - "type": "String", - "optional": true, - "defaultValue": null + "type": "String" }] }, { "name": "algorithms/Dictionary.fromLists", @@ -15739,7 +15737,7 @@ }] }, { "name": "algorithms/Reducer.kendallsCorrelation", - "description": "Creates a reducer that computes the Kendall\u0027s Tau-b rank correlation. A positive tau value indicates an increasing trend; negative value indicates a decreasing trend. See https://commons.apache.org/proper/commons-math/javadocs/api-3.6/org/apache/commons/math3/stat/correlation/KendallsCorrelation.html for details.", + "description": "Creates a reducer that computes the Kendall\u0027s Tau-b rank correlation. A positive tau value indicates an increasing trend; negative value indicates a decreasing trend. See https://commons.apache.org/proper/commons-math/javadocs/api-3.6.1/org/apache/commons/math3/stat/correlation/KendallsCorrelation.html for details.", "returnType": "Reducer", "arguments": [{ "argumentName": "numInputs", diff --git a/python/ee/tests/data_test.py b/python/ee/tests/data_test.py index 166c55d63..cc6c8c328 100644 --- a/python/ee/tests/data_test.py +++ b/python/ee/tests/data_test.py @@ -151,6 +151,37 @@ def testCreateFolder(self): asset = mock_create_asset.call_args.kwargs['body'] self.assertEqual(asset, {'type': 'FOLDER'}) + @unittest.skip('Does not work on github with python 3.7') + def testStartIngestion(self): + cloud_api_resource = mock.MagicMock() + with apitestcase.UsingCloudApi(cloud_api_resource=cloud_api_resource): + mock_result = {'name': 'operations/ingestion', 'done': False} + cloud_api_resource.projects().image().import_().execute.return_value = ( + mock_result + ) + manifest = { + 'id': 'projects/some-project/assets/some-name', + 'arg': 'something', + } + result = ee.data.startIngestion( + 'request_id', + manifest, + True + ) + self.assertEqual(result['id'], 'ingestion') + self.assertEqual(result['name'], 'operations/ingestion') + + mock_import = cloud_api_resource.projects().image().import_ + import_args = mock_import.call_args.kwargs['body'] + self.assertEqual( + import_args['imageManifest'], + { + 'name': 'projects/some-project/assets/some-name', + 'arg': 'something', + }, + ) + self.assertTrue(import_args['overwrite']) + def testSetAssetProperties(self): mock_http = mock.MagicMock(httplib2.Http) with apitestcase.UsingCloudApi(mock_http=mock_http), mock.patch.object( diff --git a/python/ee/tests/ee_number_test.py b/python/ee/tests/ee_number_test.py index b09280424..ce233fdd1 100644 --- a/python/ee/tests/ee_number_test.py +++ b/python/ee/tests/ee_number_test.py @@ -1,11 +1,23 @@ #!/usr/bin/env python3 """Test for the ee.number module.""" +import json +from typing import Any, Dict + import ee from ee import apitestcase import unittest +def make_expression_graph( + function_invocation_value: Dict[str, Any], +) -> Dict[str, Any]: + return { + 'result': '0', + 'values': {'0': {'functionInvocationValue': function_invocation_value}}, + } + + class NumberTest(apitestcase.ApiTestCase): def testNumber(self): @@ -33,6 +45,1091 @@ def testInternals(self): self.assertNotEqual(b, c) self.assertNotEqual(hash(a), hash(b)) + def test_abs(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.abs', + }) + expression = ee.Number(1).abs() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_acos(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.acos', + }) + expression = ee.Number(1).acos() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_add(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.add', + }) + expression = ee.Number(1).add(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).add(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + # `and` not possible with the python parser, so it is exposed as `And`. + def test_and(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.and', + }) + expression = ee.Number(1).And(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).And(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_asin(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.asin', + }) + expression = ee.Number(1).asin() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_atan(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.atan', + }) + expression = ee.Number(1).atan() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_atan2(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.atan2', + }) + expression = ee.Number(1).atan2(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).atan2(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_bitCount(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.bitCount', + }) + expression = ee.Number(1).bitCount() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_bitwiseAnd(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.bitwiseAnd', + }) + expression = ee.Number(1).bitwiseAnd(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).bitwiseAnd(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_bitwiseNot(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.bitwiseNot', + }) + expression = ee.Number(1).bitwiseNot() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_bitwiseOr(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.bitwiseOr', + }) + expression = ee.Number(1).bitwiseOr(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).bitwiseOr(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_bitwiseXor(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.bitwiseXor', + }) + expression = ee.Number(1).bitwiseXor(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).bitwiseXor(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_byte(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.byte', + }) + expression = ee.Number(1).byte() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_cbrt(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.cbrt', + }) + expression = ee.Number(1).cbrt() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_ceil(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.ceil', + }) + expression = ee.Number(1).ceil() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_clamp(self): + expect = make_expression_graph({ + 'arguments': { + 'number': {'constantValue': 1}, + 'min': {'constantValue': 2}, + 'max': {'constantValue': 3}, + }, + 'functionName': 'Number.clamp', + }) + expression = ee.Number(1).clamp(2, 3) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).clamp(min=2, max=3) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_cos(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.cos', + }) + expression = ee.Number(1).cos() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_cosh(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.cosh', + }) + expression = ee.Number(1).cosh() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_digamma(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.digamma', + }) + expression = ee.Number(1).digamma() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_divide(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.divide', + }) + expression = ee.Number(1).divide(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).divide(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_double(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.double', + }) + expression = ee.Number(1).double() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_eq(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.eq', + }) + expression = ee.Number(1).eq(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).eq(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_erf(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.erf', + }) + expression = ee.Number(1).erf() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_erfInv(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.erfInv', + }) + expression = ee.Number(1).erfInv() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_erfc(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.erfc', + }) + expression = ee.Number(1).erfc() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_erfcInv(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.erfcInv', + }) + expression = ee.Number(1).erfcInv() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_exp(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.exp', + }) + expression = ee.Number(1).exp() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_first(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.first', + }) + expression = ee.Number(1).first(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).first(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_firstNonZero(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.firstNonZero', + }) + expression = ee.Number(1).firstNonZero(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).firstNonZero(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_float(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.float', + }) + expression = ee.Number(1).float() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_floor(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.floor', + }) + expression = ee.Number(1).floor() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_format(self): + expect = make_expression_graph({ + 'arguments': { + 'number': {'constantValue': 1}, + 'pattern': {'constantValue': 'a'}, + }, + 'functionName': 'Number.format', + }) + expression = ee.Number(1).format('a') + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).format(pattern='a') + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_gamma(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.gamma', + }) + expression = ee.Number(1).gamma() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_gammainc(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.gammainc', + }) + expression = ee.Number(1).gammainc(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).gammainc(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_gt(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.gt', + }) + expression = ee.Number(1).gt(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).gt(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_gte(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.gte', + }) + expression = ee.Number(1).gte(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).gte(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_hypot(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.hypot', + }) + expression = ee.Number(1).hypot(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).hypot(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_int(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.int', + }) + expression = ee.Number(1).int() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_int16(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.int16', + }) + expression = ee.Number(1).int16() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_int32(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.int32', + }) + expression = ee.Number(1).int32() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_int64(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.int64', + }) + expression = ee.Number(1).int64() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_int8(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.int8', + }) + expression = ee.Number(1).int8() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_lanczos(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.lanczos', + }) + expression = ee.Number(1).lanczos() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_leftShift(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.leftShift', + }) + expression = ee.Number(1).leftShift(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).leftShift(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_log(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.log', + }) + expression = ee.Number(1).log() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_log10(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.log10', + }) + expression = ee.Number(1).log10() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_long(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.long', + }) + expression = ee.Number(1).long() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_lt(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.lt', + }) + expression = ee.Number(1).lt(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).lt(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_lte(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.lte', + }) + expression = ee.Number(1).lte(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).lte(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_max(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.max', + }) + expression = ee.Number(1).max(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).max(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_min(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.min', + }) + expression = ee.Number(1).min(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).min(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_mod(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.mod', + }) + expression = ee.Number(1).mod(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).mod(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_multiply(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.multiply', + }) + expression = ee.Number(1).multiply(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).multiply(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_neq(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.neq', + }) + expression = ee.Number(1).neq(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).neq(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_not(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.not', + }) + expression = ee.Number(1).Not() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_or(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.or', + }) + expression = ee.Number(1).Or(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).Or(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + # TODO: test_parse. + + def test_pow(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.pow', + }) + expression = ee.Number(1).pow(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).pow(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_rightShift(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.rightShift', + }) + expression = ee.Number(1).rightShift(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).rightShift(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_round(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.round', + }) + expression = ee.Number(1).round() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_short(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.short', + }) + expression = ee.Number(1).short() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_signum(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.signum', + }) + expression = ee.Number(1).signum() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_sin(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.sin', + }) + expression = ee.Number(1).sin() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_sinh(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.sinh', + }) + expression = ee.Number(1).sinh() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_sqrt(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.sqrt', + }) + expression = ee.Number(1).sqrt() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_subtract(self): + expect = make_expression_graph({ + 'arguments': { + 'left': {'constantValue': 1}, + 'right': {'constantValue': 2}, + }, + 'functionName': 'Number.subtract', + }) + expression = ee.Number(1).subtract(2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).subtract(right=2) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_tan(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.tan', + }) + expression = ee.Number(1).tan() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_tanh(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.tanh', + }) + expression = ee.Number(1).tanh() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toByte(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toByte', + }) + expression = ee.Number(1).toByte() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toDouble(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toDouble', + }) + expression = ee.Number(1).toDouble() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toFloat(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toFloat', + }) + expression = ee.Number(1).toFloat() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toInt(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toInt', + }) + expression = ee.Number(1).toInt() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toInt16(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toInt16', + }) + expression = ee.Number(1).toInt16() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toInt32(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toInt32', + }) + expression = ee.Number(1).toInt32() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toInt64(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toInt64', + }) + expression = ee.Number(1).toInt64() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toInt8(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toInt8', + }) + expression = ee.Number(1).toInt8() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toLong(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toLong', + }) + expression = ee.Number(1).toLong() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toShort(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toShort', + }) + expression = ee.Number(1).toShort() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toUint16(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toUint16', + }) + expression = ee.Number(1).toUint16() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toUint32(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toUint32', + }) + expression = ee.Number(1).toUint32() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_toUint8(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.toUint8', + }) + expression = ee.Number(1).toUint8() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_trigamma(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.trigamma', + }) + expression = ee.Number(1).trigamma() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_uint16(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.uint16', + }) + expression = ee.Number(1).uint16() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_uint32(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.uint32', + }) + expression = ee.Number(1).uint32() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_uint8(self): + expect = make_expression_graph({ + 'arguments': { + 'input': {'constantValue': 1}, + }, + 'functionName': 'Number.uint8', + }) + expression = ee.Number(1).uint8() + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + def test_unitScale(self): + expect = make_expression_graph({ + 'arguments': { + 'number': {'constantValue': 1}, + 'min': {'constantValue': 2}, + 'max': {'constantValue': 3}, + }, + 'functionName': 'Number.unitScale', + }) + expression = ee.Number(1).unitScale(2, 3) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + + expression = ee.Number(1).unitScale(min=2, max=3) + result = json.loads(expression.serialize()) + self.assertEqual(expect, result) + if __name__ == '__main__': unittest.main() diff --git a/python/pyproject.toml b/python/pyproject.toml index e90cb3cb0..765f1d4e7 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "earthengine-api" -version = "0.1.398" +version = "0.1.399" description = "Earth Engine Python API" requires-python = ">=3.7" keywords = [