earthengine-api 1.5.11__py3-none-any.whl → 1.5.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of earthengine-api might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: earthengine-api
3
- Version: 1.5.11
3
+ Version: 1.5.12
4
4
  Summary: Earth Engine Python API
5
5
  Author-email: Google LLC <noreply@google.com>
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
- earthengine_api-1.5.11.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
- ee/__init__.py,sha256=Yy2FL8GFl1cru46xPOHRNjvI_zNMH4u1MhLeKMQujGo,16747
1
+ earthengine_api-1.5.12.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
+ ee/__init__.py,sha256=3QWguxLJbrT4edziVD9KdyjpOAu95LyTbkNahnNO6sM,16854
3
3
  ee/_arg_types.py,sha256=iKWKK4KjkgIv6s4hZDCakHLdBxVp3jcoBsbaJYjtIe4,2674
4
4
  ee/_cloud_api_utils.py,sha256=ABvZ6h80GHndnoDVM6Q0i8xsFe4z5gD6K1sGpU4T8TA,32485
5
5
  ee/_helpers.py,sha256=roBMok5ZvoWmQx2Pd4F26uTFN1q-SNeoFiHo-aGuE0A,4684
@@ -10,7 +10,7 @@ ee/batch.py,sha256=FKZ216W-UvTEFLs_CBXlb9BDVaejqz8G4_GsKRiFtu0,82684
10
10
  ee/blob.py,sha256=CBxYaELE3o91MxnD0YpT9GFhncongZatSIl1XDUh1dc,3211
11
11
  ee/classifier.py,sha256=bvXDGZN9_XyGeDPc72mU-Y5piw1uus5vRec0Kitm7NY,23610
12
12
  ee/clusterer.py,sha256=ndim_Iu3BFuOOw46mry1XKSEx_4SmAcLYZvOYIdCaFM,12402
13
- ee/collection.py,sha256=wekvHxulFrbN-T9Zz40HCQndV7WkMMJjES7o-WqjS1U,31548
13
+ ee/collection.py,sha256=Zvnznv7SWdFTb0zYRiQHIhbFhD3SCOQJPPDqmVMT3HA,32433
14
14
  ee/computedobject.py,sha256=bHbMSYnzeeJyPspCSGCbD6_OiJte5-tCbmTqWqkPgKw,9118
15
15
  ee/confusionmatrix.py,sha256=PiNvwEitqBRzreZuasQKzsTQSV6rYb4yEmVPY8Sq5R4,4266
16
16
  ee/customfunction.py,sha256=fc-c0FuhX2En6iCMparExnn2gl592MV5_09D8lXDIME,7403
@@ -29,19 +29,19 @@ ee/ee_types.py,sha256=MWfXc0h3KgT8bLraI6qw-b0D3ogVkY5aDZKM3eoTsJA,3089
29
29
  ee/element.py,sha256=awb1ufzfC9YwzonH0V3KKkTRbM-sFc2yPoSDjFsHjLE,6305
30
30
  ee/encodable.py,sha256=vifFNsZt6WxZA3qpJR9Lg94YdLQEOj2Bh0CffrINcL8,1734
31
31
  ee/errormargin.py,sha256=worYjc36VNP_M76NxlCFpXtq1HBfHThug1sOKUkaV8Q,3061
32
- ee/feature.py,sha256=k9fnUkBG-4W5WHR0UFN_FOnP8MIRUhdh_LeMzHCoVwU,30258
32
+ ee/feature.py,sha256=TwXn_uwvjBOremgoow-dbykFL59h6ortI1I7UDLdM-8,30543
33
33
  ee/featurecollection.py,sha256=BZbhXhpSJD87RrilBVVJZb3pH-_w7ZuNd4tdSSPr620,14510
34
34
  ee/filter.py,sha256=YFkir1W4QOBvoWM8OF_LdcEBDZu5YNGey4hgA0iILUw,35616
35
35
  ee/function.py,sha256=YxQjqdjEI5n2rOzemPSqQ05NDqQC6Wq3srAwCIrDVtU,7068
36
- ee/geometry.py,sha256=_BBRXYkAtr4ifqS1Iu_cnzlau7xRSX3twNh0Q4F2hAk,59289
37
- ee/image.py,sha256=s6jamW1C6b7KC6koqo_oMNLL0CeBTGREt7NBA8rQqdI,171476
36
+ ee/geometry.py,sha256=a4fnTtSR_SwyQxlOgWO3E4jSVJdbsmmWRRFRorAQzkA,59575
37
+ ee/image.py,sha256=8L__ZYiwQCkH47PC2hSRh2OCTva4Z7vPymk9AK7_Zs8,171643
38
38
  ee/image_converter.py,sha256=EPx2kZF8pR3mSin4Yp3RFy3rSeQ05X4WIUqj5sxgRaM,1506
39
39
  ee/imagecollection.py,sha256=agZKJ9c5VdjQh3IDOGjjk1IVU032Q4RSvACuOy3pKHE,27135
40
40
  ee/join.py,sha256=bzdGeNSIOYZf9MD5gekDRpQ9oAOuKsSftrPM3e7xssQ,7646
41
41
  ee/kernel.py,sha256=xppt5uEQnP1BQl0XxJ8XT-pwbFl_MdggZWfBSQRGA9I,15196
42
42
  ee/mapclient.py,sha256=QpUpKreEgOkjSXQBnfyViCwLQGiumHbKr-EA076XLYk,17500
43
- ee/model.py,sha256=7RnhAz6ErxyalWKU4fH57oWVOayLlZl6v2wb_B8SZWY,11965
44
- ee/oauth.py,sha256=tYZ4WFjxNohAcc-tRMtnoQLhgS-f0l1JKn3tTY8paco,21760
43
+ ee/model.py,sha256=nXn0qhwKgiTA6xOUQ7aFe0o6Mis68hiywLoY9twLOj0,12185
44
+ ee/oauth.py,sha256=nwE92VvCr8C_U5UN0iR41iXROWe-0TduX_aSngXXnuo,21906
45
45
  ee/pixeltype.py,sha256=Q1bsWN9LJGlOrYWOvq8o4-drSKaNFEap4LsP6A99jNw,5235
46
46
  ee/projection.py,sha256=7zPeJI9Edq5ZJzggUY3whjcq50rTPeeYCOPxjQXWDN0,5863
47
47
  ee/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -57,7 +57,7 @@ ee/cli/utils.py,sha256=LUkogw-jOwks7s-rcriWIGKI3hQYOhQ6uuJYl_uHB4E,13864
57
57
  ee/tests/_cloud_api_utils_test.py,sha256=SANsImcCZDnEcbV0nBFwT5QYM76XtAuppFns5SurM-o,18816
58
58
  ee/tests/_helpers_test.py,sha256=exOYxGKSiXHKQF3Tn189LVfP7wcAXbmAy3BkS0690yY,1941
59
59
  ee/tests/_utils_test.py,sha256=bOarVj3U-VFo9Prog8WQN_hAOMwJOiWKJxevUbdFPBQ,2753
60
- ee/tests/algorithms.json,sha256=qH26WBALTPw_FeOWI8ND2RZPe6NyUt2slAziOkX9zd0,721923
60
+ ee/tests/algorithms.json,sha256=tysb9n5yCMxHvsyd5eNmWFKD5SI4b3HJm7BG1fp72RE,722260
61
61
  ee/tests/apifunction_test.py,sha256=62El-6jcgQmD7qt9eEDdM7IeIQmpV8M5xQ439g-zfN4,3767
62
62
  ee/tests/batch_test.py,sha256=UdNmismzpVhH_h_iTNvfHIru9Sa8RyoN2WVSmwScZF4,62212
63
63
  ee/tests/blob_test.py,sha256=JqKRhREvZ-ZdTMjH9SdvdKieKg2FTj76hpSYMV3xZqI,3581
@@ -67,7 +67,7 @@ ee/tests/clusterer_test.py,sha256=ZBha-kLPJz4HGofw7Zm-_d0MACBiYd-6Zi_1Brg1eHc,11
67
67
  ee/tests/collection_test.py,sha256=dnZwFADWQ8oShJHRTcYSzuP-waAxetTdM_CtVckWbMM,7563
68
68
  ee/tests/computedobject_test.py,sha256=B27rDq9Urpvy0WqpdbKRYbt6AcT1i93HX-es7hrhWVY,4840
69
69
  ee/tests/confusionmatrix_test.py,sha256=L7-yXE1XkWmw-n890Vra9WrjgoxP3R1qwtq2mDtcFEI,7443
70
- ee/tests/data_test.py,sha256=NQQa-ifmppXiG9U0X29CDLrICGwqz616mf6zTgHHwlM,35203
70
+ ee/tests/data_test.py,sha256=HNHI2RDL9oFzA_-dG48zYtpc10I9HeCdFa5vtyndInY,35299
71
71
  ee/tests/daterange_test.py,sha256=CFVCIrfGz7ZqZCjAbyrP-j3tsd4auDdS-Pu8xvqEc5A,8589
72
72
  ee/tests/deprecation_test.py,sha256=P3_Rn8-7QqfQ9ztvxrTlqF9-oL3Y-brCmxgMVbc75Qc,8358
73
73
  ee/tests/deserializer_test.py,sha256=0zWOJS5AQwpdm4RGFu0navyOKMOAutEh94ELY1kyCjg,3041
@@ -81,15 +81,15 @@ ee/tests/ee_test.py,sha256=t_YzfCBkKkqf4MM9yT8pN2Rb2S3FNp_3-CvkKe-uEHc,17064
81
81
  ee/tests/ee_types_test.py,sha256=oRnqplaTWg47zuYfAYTTVwembCnw8XT20HPNMdAvgNE,921
82
82
  ee/tests/element_test.py,sha256=Kqu_Z65FQcYHX4LebKm3LD0mWkRTRZccs-qAGz3bLsE,1964
83
83
  ee/tests/errormargin_test.py,sha256=UVi3YcpUvo4nQCJJ3hE5a28bBTWeDt1gYvkZ2tkTNco,5066
84
- ee/tests/feature_test.py,sha256=iJQN-UMN60RIWQp8N20a9o2O1Ci8OgBt13rre8DjmqY,22247
85
- ee/tests/featurecollection_test.py,sha256=SPdbEw8tzPm7V7rONh2s-pg0E0il8hOHI-FV_m4Y0yw,37212
84
+ ee/tests/feature_test.py,sha256=lWVA4DuFMhQrnEww5ttiCuniUVR9g6tks4S3OgcJ1vI,22511
85
+ ee/tests/featurecollection_test.py,sha256=XuW3WswrNgMxCzMuhjFNPgTvirJ4oyIFRuQkjlLYVZU,38446
86
86
  ee/tests/filter_test.py,sha256=wRidsH38DnYeHnFt48XOEwfxVlu0JiVbHx5_cutyhNs,35039
87
87
  ee/tests/function_test.py,sha256=NbluwBCuWUZSzbMLAa04OP_qd95ibMjJWWNuM2P3Izo,3121
88
- ee/tests/geometry_point_test.py,sha256=TphkEMfcXcSzc5-_iflN5gmkToJf57nB5XNA_BETww4,14873
88
+ ee/tests/geometry_point_test.py,sha256=oPB0NLmGINt5IEIMfJmgUgItEMef8LHupbm_I8xfODM,15099
89
89
  ee/tests/geometry_test.py,sha256=z010i7CgwX8taJGk0NaMh6ArUDTIZllFgyZrMSpNFlI,30732
90
90
  ee/tests/image_converter_test.py,sha256=kBFq3Ij2mNuAAMoUDqyT0IH2XzHtn9MCiijzyQxGifU,1891
91
- ee/tests/image_test.py,sha256=VTUxjMQXtP1aHuaq1VmsfUJh5BemHdyhQRKMY75NhDk,150706
92
- ee/tests/imagecollection_test.py,sha256=uCnYEJNHppJnrLuO3ucGYHfglKrJnsyHqkAis_bdUfw,37214
91
+ ee/tests/image_test.py,sha256=wRMJ0hVH8o9PS3SvJXu22W8zmYXgpRRySpoLEOp8tu0,150923
92
+ ee/tests/imagecollection_test.py,sha256=wzN-N91bavK5qdkrlBOaMfSKYaeUwoKzvCWGHxm7NL8,38450
93
93
  ee/tests/join_test.py,sha256=ikS4ztMkwYrWTQzebRl0JavxW4fuAshyKLx33knt91g,7636
94
94
  ee/tests/kernel_test.py,sha256=YsqElybuI7X_N421zvkuMGWh1yZQ6g_K4hDTVYiHgew,19255
95
95
  ee/tests/model_test.py,sha256=FQQhAQNwO9qS6CrwRbMSvrUb54ENWvqsXGC8LCMXDo0,12059
@@ -100,8 +100,8 @@ ee/tests/reducer_test.py,sha256=wzwESob1ZPtC2IfkmDYFkL631Ph9VtmCl2UhQQOzZBc,3152
100
100
  ee/tests/serializer_test.py,sha256=5aApenGb9_tOTM4J8zFcT0JFzAOO_Av6dYGFz93COP8,8814
101
101
  ee/tests/table_converter_test.py,sha256=HSZpEvDG-H1RATnQXcZNR8O3kEJdJ3rHc-46KTiOWpY,3385
102
102
  ee/tests/terrain_test.py,sha256=kV901v89SBKzgSNqG6k3wxh3IdDfQeNdxmD5f9ouV18,4334
103
- earthengine_api-1.5.11.dist-info/METADATA,sha256=PeJz-01ypbVWRZgPJEUMqu6atjMXuoo1NevPXw31gdQ,2143
104
- earthengine_api-1.5.11.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
105
- earthengine_api-1.5.11.dist-info/entry_points.txt,sha256=-Ax4SCU-S474r8OD2LIxata6PRmkZoDrppQ4fP_exNc,50
106
- earthengine_api-1.5.11.dist-info/top_level.txt,sha256=go5zOwCgm5lIS3yTR-Vsxp1gNI4qdS-MP5eY-7zMxVY,3
107
- earthengine_api-1.5.11.dist-info/RECORD,,
103
+ earthengine_api-1.5.12.dist-info/METADATA,sha256=WLraKgmKCW7k0Sc8TycAO6bgCQjnItbsIAyHl1puIuw,2143
104
+ earthengine_api-1.5.12.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
105
+ earthengine_api-1.5.12.dist-info/entry_points.txt,sha256=-Ax4SCU-S474r8OD2LIxata6PRmkZoDrppQ4fP_exNc,50
106
+ earthengine_api-1.5.12.dist-info/top_level.txt,sha256=go5zOwCgm5lIS3yTR-Vsxp1gNI4qdS-MP5eY-7zMxVY,3
107
+ earthengine_api-1.5.12.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (79.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
ee/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """The EE Python library."""
2
2
 
3
- __version__ = '1.5.11'
3
+ __version__ = '1.5.12'
4
4
 
5
5
  # Using lowercase function naming to match the JavaScript names.
6
6
  # pylint: disable=g-bad-name
@@ -147,6 +147,8 @@ def Authenticate(
147
147
  None - a default mode is chosen based on your environment.
148
148
  scopes: List of scopes to use for authentication. Defaults to [
149
149
  'https://www.googleapis.com/auth/earthengine',
150
+ 'https://www.googleapis.com/auth/cloud-platform',
151
+ 'https://www.googleapis.com/auth/drive',
150
152
  'https://www.googleapis.com/auth/devstorage.full_control' ].
151
153
  force: Will force authentication even if valid credentials already exist.
152
154
 
ee/collection.py CHANGED
@@ -317,6 +317,25 @@ class Collection(element.Element):
317
317
  'AggregateFeatureCollection.total_var', self, property
318
318
  )
319
319
 
320
+ def bounds(
321
+ self,
322
+ # pylint: disable-next=invalid-name
323
+ maxError: Optional[_arg_types.ErrorMargin] = None,
324
+ proj: Optional[_arg_types.Projection] = None,
325
+ ) -> ee_geometry.Geometry:
326
+ """Returns the bounding rectangle of the geometry.
327
+
328
+ Args:
329
+ maxError: The maximum amount of error tolerated when performing any
330
+ necessary reprojection.
331
+ proj: If specified, the result will be in this projection. Otherwise it
332
+ will be in EPSG:4326.
333
+ """
334
+
335
+ return apifunction.ApiFunction.call_(
336
+ 'Collection.bounds', self, maxError, proj
337
+ )
338
+
320
339
  def distance(
321
340
  self,
322
341
  # pylint: disable=invalid-name
@@ -694,10 +713,12 @@ class Collection(element.Element):
694
713
 
695
714
  def randomColumn(
696
715
  self,
697
- # pylint: disable=next=invalid-name
716
+ # pylint: disable-next=invalid-name
698
717
  columnName: Optional[_arg_types.String] = None,
699
718
  seed: Optional[_arg_types.Integer] = None,
700
719
  distribution: Optional[_arg_types.String] = None,
720
+ # pylint: disable-next=invalid-name
721
+ rowKeys: Optional[_arg_types.List] = None,
701
722
  ) -> featurecollection.FeatureCollection:
702
723
  """Returns a collection with a random column added to each feature.
703
724
 
@@ -712,10 +733,13 @@ class Collection(element.Element):
712
733
  seed: A seed used when generating the random numbers.
713
734
  distribution: The distribution type of random numbers to produce; one of
714
735
  'uniform' or 'normal'.
736
+ rowKeys: A list of properties that should uniquely and repeatably identify
737
+ an element of the collection, used to generate the random number.
738
+ Defaults to [system:index].
715
739
  """
716
740
 
717
741
  return apifunction.ApiFunction.call_(
718
- 'Collection.randomColumn', self, columnName, seed, distribution
742
+ 'Collection.randomColumn', self, columnName, seed, distribution, rowKeys
719
743
  )
720
744
 
721
745
  def reduceColumns(
ee/feature.py CHANGED
@@ -474,6 +474,7 @@ class Feature(element.Element):
474
474
  # pylint: disable-next=invalid-name
475
475
  maxError: Optional[_arg_types.ErrorMargin] = None,
476
476
  proj: Optional[_arg_types.Projection] = None,
477
+ spherical: Optional[_arg_types.Bool] = None,
477
478
  ) -> ee_number.Number:
478
479
  """Returns the minimum distance between the geometries of two features.
479
480
 
@@ -485,10 +486,13 @@ class Feature(element.Element):
485
486
  proj: The projection in which to perform the operation. If not specified,
486
487
  the operation will be performed in a spherical coordinate system, and
487
488
  linear distances will be in meters on the sphere.
489
+ spherical: If true, the calculation will be done on the unit sphere. If
490
+ false, the calculation will be elliptical, taking earth flattening into
491
+ account. Ignored if proj is specified. Default is false.
488
492
  """
489
493
 
490
494
  return apifunction.ApiFunction.call_(
491
- self.name() + '.distance', self, right, maxError, proj
495
+ self.name() + '.distance', self, right, maxError, proj, spherical
492
496
  )
493
497
 
494
498
  def geometry(
ee/geometry.py CHANGED
@@ -1243,6 +1243,7 @@ class Geometry(computedobject.ComputedObject):
1243
1243
  # pylint: disable-next=invalid-name
1244
1244
  maxError: Optional[_arg_types.ErrorMargin] = None,
1245
1245
  proj: Optional[_arg_types.Projection] = None,
1246
+ spherical: Optional[_arg_types.Bool] = None,
1246
1247
  ) -> ee_number.Number:
1247
1248
  """Returns the minimum distance between two geometries.
1248
1249
 
@@ -1253,13 +1254,17 @@ class Geometry(computedobject.ComputedObject):
1253
1254
  proj: The projection in which to perform the operation. If not specified,
1254
1255
  the operation will be performed in a spherical coordinate system, and
1255
1256
  linear distances will be in meters on the sphere.
1257
+ spherical: If true, the calculation will be done on the unit sphere. If
1258
+ false, the calculation will be elliptical, taking earth flattening into
1259
+ account. Ignored if proj is specified. Default is false.
1260
+
1256
1261
 
1257
1262
  Returns:
1258
1263
  An ee.Float.
1259
1264
  """
1260
1265
 
1261
1266
  return apifunction.ApiFunction.call_(
1262
- self.name() + '.distance', self, right, maxError, proj
1267
+ self.name() + '.distance', self, right, maxError, proj, spherical
1263
1268
  )
1264
1269
 
1265
1270
  def edgesAreGeodesics(self) -> computedobject.ComputedObject:
ee/image.py CHANGED
@@ -3075,7 +3075,7 @@ class Image(element.Element):
3075
3075
  Creates a two-band image containing the x and y coordinates of each pixel in
3076
3076
  the given projection.
3077
3077
 
3078
- args:
3078
+ Args:
3079
3079
  projection: The projection in which to provide pixels.
3080
3080
  """
3081
3081
 
@@ -3329,6 +3329,7 @@ class Image(element.Element):
3329
3329
  # pylint: disable=invalid-name
3330
3330
  crsTransform: Optional[_arg_types.List] = None,
3331
3331
  tileScale: Optional[_arg_types.Number] = None,
3332
+ maxPixelsPerRegion: Optional[_arg_types.Integer] = None,
3332
3333
  # pylint: enable=invalid-name
3333
3334
  ) -> featurecollection.FeatureCollection:
3334
3335
  """Apply a reducer over the area of each feature in the given collection.
@@ -3350,6 +3351,7 @@ class Image(element.Element):
3350
3351
  tileScale: A scaling factor used to reduce aggregation tile size; using a
3351
3352
  larger tileScale (e.g., 2 or 4) may enable computations that run out of
3352
3353
  memory with the default.
3354
+ maxPixelsPerRegion: The maximum number of pixels to reduce per region.
3353
3355
 
3354
3356
  Returns:
3355
3357
  Returns the input ee.FeatureCollection, each augmented with the
@@ -3365,6 +3367,7 @@ class Image(element.Element):
3365
3367
  crs,
3366
3368
  crsTransform,
3367
3369
  tileScale,
3370
+ maxPixelsPerRegion,
3368
3371
  )
3369
3372
 
3370
3373
  def reduceResolution(
@@ -4204,7 +4207,7 @@ class Image(element.Element):
4204
4207
  # pylint: disable=invalid-name
4205
4208
  numPoints: _arg_types.Integer,
4206
4209
  classBand: Optional[_arg_types.String] = None,
4207
- # pylint: endable=invalid-name
4210
+ # pylint: enable=invalid-name
4208
4211
  region: Optional[_arg_types.Geometry] = None,
4209
4212
  scale: Optional[_arg_types.Number] = None,
4210
4213
  projection: Optional[_arg_types.Projection] = None,
ee/model.py CHANGED
@@ -5,6 +5,7 @@ from typing import Optional
5
5
  from ee import _arg_types
6
6
  from ee import apifunction
7
7
  from ee import computedobject
8
+ from ee import deprecation
8
9
  from ee import featurecollection
9
10
  from ee import image as ee_image
10
11
 
@@ -62,6 +63,7 @@ class Model(computedobject.ComputedObject):
62
63
  return 'Model'
63
64
 
64
65
  @staticmethod
66
+ @deprecation.Deprecated('Migrate to Vertex AI')
65
67
  def fromAiPlatformPredictor(
66
68
  # pylint: disable=invalid-name
67
69
  projectName: Optional[_arg_types.Any] = None,
@@ -88,6 +90,9 @@ class Model(computedobject.ComputedObject):
88
90
  ) -> 'Model':
89
91
  """Returns an ee.Model from a description of an AI Platform prediction model.
90
92
 
93
+ DEPRECATED: Cloud AI Platform is deprecated migrate to Vertex AI:
94
+ https://developers.google.com/earth-engine/guides/ee-vertex-migrate
95
+
91
96
  (See https://cloud.google.com/ml-engine/).
92
97
 
93
98
  Args:
ee/oauth.py CHANGED
@@ -44,6 +44,7 @@ CLIENT_SECRET = 'RUP0RZ6e0pPhDzsqIJ7KlNd1'
44
44
  SCOPES = [
45
45
  'https://www.googleapis.com/auth/earthengine',
46
46
  'https://www.googleapis.com/auth/cloud-platform',
47
+ 'https://www.googleapis.com/auth/drive',
47
48
  'https://www.googleapis.com/auth/devstorage.full_control'
48
49
  ]
49
50
  REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob' # Prompts user to copy-paste code
@@ -494,6 +495,8 @@ def authenticate(
494
495
  None - a default mode is chosen based on your environment.
495
496
  scopes: List of scopes to use for authorization. Defaults to [
496
497
  'https://www.googleapis.com/auth/earthengine',
498
+ 'https://www.googleapis.com/auth/cloud-platform',
499
+ 'https://www.googleapis.com/auth/drive',
497
500
  'https://www.googleapis.com/auth/devstorage.full_control' ].
498
501
  force: Will force authentication even if valid credentials already exist.
499
502
 
ee/tests/algorithms.json CHANGED
@@ -1180,7 +1180,7 @@
1180
1180
  }, {
1181
1181
  "argumentName": "unit",
1182
1182
  "type": "String",
1183
- "description": "One of \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1183
+ "description": "One of \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1184
1184
  }, {
1185
1185
  "argumentName": "timeZone",
1186
1186
  "type": "String",
@@ -1201,7 +1201,7 @@
1201
1201
  }, {
1202
1202
  "argumentName": "unit",
1203
1203
  "type": "String",
1204
- "description": "One of \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1204
+ "description": "One of \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1205
1205
  }]
1206
1206
  }, {
1207
1207
  "name": "algorithms/Date.format",
@@ -1274,7 +1274,7 @@
1274
1274
  }, {
1275
1275
  "argumentName": "unit",
1276
1276
  "type": "String",
1277
- "description": "One of \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1277
+ "description": "One of \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1278
1278
  }, {
1279
1279
  "argumentName": "timeZone",
1280
1280
  "type": "String",
@@ -1292,7 +1292,7 @@
1292
1292
  }, {
1293
1293
  "argumentName": "unit",
1294
1294
  "type": "String",
1295
- "description": "One of \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1295
+ "description": "One of \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1296
1296
  }, {
1297
1297
  "argumentName": "timeZone",
1298
1298
  "type": "String",
@@ -1310,11 +1310,11 @@
1310
1310
  }, {
1311
1311
  "argumentName": "unit",
1312
1312
  "type": "String",
1313
- "description": "One of \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1313
+ "description": "One of \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027."
1314
1314
  }, {
1315
1315
  "argumentName": "inUnit",
1316
1316
  "type": "String",
1317
- "description": "One of \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, or \u0027minute\u0027."
1317
+ "description": "One of \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, or \u0027minute\u0027."
1318
1318
  }, {
1319
1319
  "argumentName": "timeZone",
1320
1320
  "type": "String",
@@ -1351,7 +1351,7 @@
1351
1351
  }]
1352
1352
  }, {
1353
1353
  "name": "algorithms/Date.unitRatio",
1354
- "description": "Returns the ratio of the length of one unit to the length of another, e.g., unitRatio(\u0027day\u0027, \u0027minute\u0027) returns 1440. Valid units are \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, and \u0027second\u0027.",
1354
+ "description": "Returns the ratio of the length of one unit to the length of another, e.g., unitRatio(\u0027day\u0027, \u0027minute\u0027) returns 1440. Valid units are \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, and \u0027second\u0027.",
1355
1355
  "returnType": "Float",
1356
1356
  "arguments": [{
1357
1357
  "argumentName": "numerator",
@@ -1597,7 +1597,7 @@
1597
1597
  }, {
1598
1598
  "argumentName": "unit",
1599
1599
  "type": "String",
1600
- "description": "The units in which \u0027delta\u0027 is specified:One of \u0027year\u0027, \u0027month\u0027 \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027.",
1600
+ "description": "The units in which \u0027delta\u0027 is specified:One of \u0027year\u0027, \u0027month\u0027, \u0027week\u0027, \u0027day\u0027, \u0027hour\u0027, \u0027minute\u0027, or \u0027second\u0027.",
1601
1601
  "optional": true,
1602
1602
  "defaultValue": "day"
1603
1603
  }, {
@@ -6116,6 +6116,12 @@
6116
6116
  "description": "The distribution type of random numbers to produce; one of \u0027uniform\u0027 or \u0027normal\u0027.",
6117
6117
  "optional": true,
6118
6118
  "defaultValue": "uniform"
6119
+ }, {
6120
+ "argumentName": "rowKeys",
6121
+ "type": "List\u003cString\u003e",
6122
+ "description": "A list of properties that should uniquely and repeatably identify an element of the collection, used to generate the random number. Defaults to [system:index].",
6123
+ "optional": true,
6124
+ "defaultValue": ["system:index"]
6119
6125
  }]
6120
6126
  }, {
6121
6127
  "name": "algorithms/Collection.reduceToImage",
ee/tests/data_test.py CHANGED
@@ -64,6 +64,7 @@ class DataTest(unittest.TestCase):
64
64
 
65
65
  def testSetMaxRetries(self):
66
66
  mock_result = {'result': 5}
67
+ original_max_retries = ee.data._max_retries
67
68
  ee.data.setMaxRetries(3)
68
69
  cloud_api_resource = mock.MagicMock()
69
70
  with apitestcase.UsingCloudApi(cloud_api_resource=cloud_api_resource):
@@ -78,6 +79,7 @@ class DataTest(unittest.TestCase):
78
79
  .compute()
79
80
  .execute.call_args.kwargs['num_retries'],
80
81
  )
82
+ ee.data._max_retries = original_max_retries
81
83
 
82
84
  def testListOperations(self):
83
85
  mock_http = mock.MagicMock(httplib2.Http)
ee/tests/feature_test.py CHANGED
@@ -392,13 +392,23 @@ class FeatureTest(apitestcase.ApiTestCase):
392
392
  self.assertEqual(expect, result)
393
393
 
394
394
  def test_distance(self):
395
+ max_error = 10
396
+ spherical = True
395
397
  expect = right_maxerror_proj('distance')
396
- expression = ee.Feature(None).distance(ee.Feature(None), 10, EPSG_4326)
398
+ argugments = expect['values']['0']['functionInvocationValue']['arguments']
399
+ argugments['spherical'] = {'constantValue': spherical}
400
+
401
+ expression = ee.Feature(None).distance(
402
+ ee.Feature(None), max_error, EPSG_4326, spherical
403
+ )
397
404
  result = json.loads(expression.serialize())
398
405
  self.assertEqual(expect, result)
399
406
 
400
407
  expression = ee.Feature(None).distance(
401
- right=ee.Feature(None), maxError=10, proj=EPSG_4326
408
+ right=ee.Feature(None),
409
+ maxError=max_error,
410
+ proj=EPSG_4326,
411
+ spherical=spherical,
402
412
  )
403
413
  result = json.loads(expression.serialize())
404
414
  self.assertEqual(expect, result)
@@ -476,6 +476,38 @@ class FeatureCollectionTest(apitestcase.ApiTestCase):
476
476
  result = json.loads(expression.serialize())
477
477
  self.assertEqual(expect, result)
478
478
 
479
+ def test_bounds(self):
480
+ # Inherited from Collection.bounds.
481
+ collection = ee.FeatureCollection('a')
482
+ max_error = 1.1
483
+ proj = 'EPSG:4326'
484
+ expect = make_expression_graph({
485
+ 'arguments': {
486
+ 'collection': FEATURES_A,
487
+ 'maxError': {
488
+ 'functionInvocationValue': {
489
+ 'functionName': 'ErrorMargin',
490
+ 'arguments': {'value': {'constantValue': max_error}},
491
+ }
492
+ },
493
+ 'proj': {
494
+ 'functionInvocationValue': {
495
+ 'arguments': {'crs': {'constantValue': proj}},
496
+ 'functionName': 'Projection',
497
+ }
498
+ },
499
+ },
500
+ # Not a FeatureCollection.
501
+ 'functionName': 'Collection.bounds',
502
+ })
503
+ expression = collection.bounds(max_error, proj)
504
+ result = json.loads(expression.serialize())
505
+ self.assertEqual(expect, result)
506
+
507
+ expression = collection.bounds(maxError=max_error, proj=proj)
508
+ result = json.loads(expression.serialize())
509
+ self.assertEqual(expect, result)
510
+
479
511
  def test_classify(self):
480
512
  output_name = 'output name'
481
513
  expect = make_expression_graph({
@@ -833,21 +865,28 @@ class FeatureCollectionTest(apitestcase.ApiTestCase):
833
865
  column_name = 'column a'
834
866
  seed = 1
835
867
  distribution = 'uniform'
868
+ row_keys = ['system:index']
836
869
  expect = make_expression_graph({
837
870
  'arguments': {
838
871
  'collection': FEATURES_A,
839
872
  'columnName': {'constantValue': column_name},
840
873
  'seed': {'constantValue': seed},
841
874
  'distribution': {'constantValue': distribution},
875
+ 'rowKeys': {'constantValue': row_keys},
842
876
  },
843
877
  'functionName': 'Collection.randomColumn',
844
878
  })
845
- expression = collection.randomColumn(column_name, seed, distribution)
879
+ expression = collection.randomColumn(
880
+ column_name, seed, distribution, row_keys
881
+ )
846
882
  result = json.loads(expression.serialize())
847
883
  self.assertEqual(expect, result)
848
884
 
849
885
  expression = collection.randomColumn(
850
- columnName=column_name, seed=seed, distribution=distribution
886
+ columnName=column_name,
887
+ seed=seed,
888
+ distribution=distribution,
889
+ rowKeys=row_keys,
851
890
  )
852
891
  result = json.loads(expression.serialize())
853
892
  self.assertEqual(expect, result)
@@ -300,18 +300,30 @@ class GeometryPointTest(apitestcase.ApiTestCase):
300
300
  self.assertEqual(actual, expect)
301
301
 
302
302
  def test_distance(self):
303
+ spherical = True
303
304
  expect = make_expression_graph_geom(
304
305
  'distance',
305
- {'left': POINT, 'right': POINT2, 'maxError': MAX_ERROR, 'proj': PROJ},
306
+ {
307
+ 'left': POINT,
308
+ 'right': POINT2,
309
+ 'maxError': MAX_ERROR,
310
+ 'proj': PROJ,
311
+ 'spherical': {'constantValue': spherical},
312
+ },
306
313
  )
307
314
  actual = json.loads(
308
- self.point.distance(self.point2, MAX_ERROR_VAL, EPSG).serialize()
315
+ self.point.distance(
316
+ self.point2, MAX_ERROR_VAL, EPSG, spherical
317
+ ).serialize()
309
318
  )
310
319
  self.assertEqual(actual, expect)
311
320
 
312
321
  actual = json.loads(
313
322
  self.point.distance(
314
- right=self.point2, maxError=MAX_ERROR_VAL, proj=EPSG
323
+ right=self.point2,
324
+ maxError=MAX_ERROR_VAL,
325
+ proj=EPSG,
326
+ spherical=spherical,
315
327
  ).serialize()
316
328
  )
317
329
  self.assertEqual(actual, expect)
ee/tests/image_test.py CHANGED
@@ -3505,6 +3505,7 @@ class SerializeTest(apitestcase.ApiTestCase):
3505
3505
  crs = EPSG_4326
3506
3506
  crs_transform = [3, 4, 5, 6, 7, 8]
3507
3507
  tile_scale = 10
3508
+ maxPixelsPerRegion = 11
3508
3509
  expect = make_expression_graph({
3509
3510
  'arguments': {
3510
3511
  'image': IMAGE,
@@ -3540,11 +3541,18 @@ class SerializeTest(apitestcase.ApiTestCase):
3540
3541
  },
3541
3542
  'crsTransform': {'constantValue': crs_transform},
3542
3543
  'tileScale': {'constantValue': tile_scale},
3544
+ 'maxPixelsPerRegion': {'constantValue': maxPixelsPerRegion},
3543
3545
  },
3544
3546
  'functionName': 'Image.reduceRegions',
3545
3547
  })
3546
3548
  expression = ee.Image('a').reduceRegions(
3547
- featurecollection, reducer, scale, crs, crs_transform, tile_scale
3549
+ featurecollection,
3550
+ reducer,
3551
+ scale,
3552
+ crs,
3553
+ crs_transform,
3554
+ tile_scale,
3555
+ maxPixelsPerRegion,
3548
3556
  )
3549
3557
  result = json.loads(expression.serialize())
3550
3558
  self.assertEqual(expect, result)
@@ -3556,6 +3564,7 @@ class SerializeTest(apitestcase.ApiTestCase):
3556
3564
  crs=crs,
3557
3565
  crsTransform=crs_transform,
3558
3566
  tileScale=tile_scale,
3567
+ maxPixelsPerRegion=maxPixelsPerRegion,
3559
3568
  )
3560
3569
  result = json.loads(expression.serialize())
3561
3570
  self.assertEqual(expect, result)
@@ -412,6 +412,38 @@ class ImageCollectionTest(apitestcase.ApiTestCase):
412
412
  result = json.loads(expression.serialize())
413
413
  self.assertEqual(expect, result)
414
414
 
415
+ def test_bounds(self):
416
+ # Inherited from Collection.bounds.
417
+ collection = ee.ImageCollection('a')
418
+ max_error = 1.1
419
+ proj = 'EPSG:4326'
420
+ expect = make_expression_graph({
421
+ 'arguments': {
422
+ 'collection': IMAGES_A,
423
+ 'maxError': {
424
+ 'functionInvocationValue': {
425
+ 'functionName': 'ErrorMargin',
426
+ 'arguments': {'value': {'constantValue': max_error}},
427
+ }
428
+ },
429
+ 'proj': {
430
+ 'functionInvocationValue': {
431
+ 'arguments': {'crs': {'constantValue': proj}},
432
+ 'functionName': 'Projection',
433
+ }
434
+ },
435
+ },
436
+ # Not an ImageCollection.
437
+ 'functionName': 'Collection.bounds',
438
+ })
439
+ expression = collection.bounds(max_error, proj)
440
+ result = json.loads(expression.serialize())
441
+ self.assertEqual(expect, result)
442
+
443
+ expression = collection.bounds(maxError=max_error, proj=proj)
444
+ result = json.loads(expression.serialize())
445
+ self.assertEqual(expect, result)
446
+
415
447
  def test_cast(self):
416
448
  band_types = {'a': 'int8'}
417
449
  band_order = ['a']
@@ -501,7 +533,7 @@ class ImageCollectionTest(apitestcase.ApiTestCase):
501
533
  'searchRadius': {'constantValue': search_radius},
502
534
  'maxError': {'constantValue': max_error},
503
535
  },
504
- # Not FeatureCollection.
536
+ # Not an ImageCollection.
505
537
  'functionName': 'Collection.distance',
506
538
  })
507
539
  expression = features.distance(search_radius, max_error)
@@ -632,7 +664,7 @@ class ImageCollectionTest(apitestcase.ApiTestCase):
632
664
  'maxError': {
633
665
  'functionInvocationValue': {
634
666
  'functionName': 'ErrorMargin',
635
- 'arguments': {'value': {'constantValue': 1.1}},
667
+ 'arguments': {'value': {'constantValue': max_error}},
636
668
  }
637
669
  },
638
670
  },
@@ -747,21 +779,28 @@ class ImageCollectionTest(apitestcase.ApiTestCase):
747
779
  column_name = 'column a'
748
780
  seed = 1
749
781
  distribution = 'uniform'
782
+ row_keys = ['system:index']
750
783
  expect = make_expression_graph({
751
784
  'arguments': {
752
785
  'collection': IMAGES_A,
753
786
  'columnName': {'constantValue': column_name},
754
787
  'seed': {'constantValue': seed},
755
788
  'distribution': {'constantValue': distribution},
789
+ 'rowKeys': {'constantValue': row_keys},
756
790
  },
757
791
  'functionName': 'Collection.randomColumn',
758
792
  })
759
- expression = collection.randomColumn(column_name, seed, distribution)
793
+ expression = collection.randomColumn(
794
+ column_name, seed, distribution, row_keys
795
+ )
760
796
  result = json.loads(expression.serialize())
761
797
  self.assertEqual(expect, result)
762
798
 
763
799
  expression = collection.randomColumn(
764
- columnName=column_name, seed=seed, distribution=distribution
800
+ columnName=column_name,
801
+ seed=seed,
802
+ distribution=distribution,
803
+ rowKeys=row_keys,
765
804
  )
766
805
  result = json.loads(expression.serialize())
767
806
  self.assertEqual(expect, result)