earthengine-api 1.5.24__py3-none-any.whl → 1.6.0__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.
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/METADATA +1 -1
- earthengine_api-1.6.0.dist-info/RECORD +107 -0
- ee/__init__.py +11 -10
- ee/_arg_types.py +2 -1
- ee/_cloud_api_utils.py +7 -6
- ee/_helpers.py +3 -2
- ee/apifunction.py +11 -9
- ee/apitestcase.py +2 -1
- ee/batch.py +46 -42
- ee/blob.py +2 -2
- ee/classifier.py +57 -59
- ee/cli/commands.py +9 -7
- ee/cli/utils.py +13 -9
- ee/clusterer.py +39 -41
- ee/collection.py +42 -42
- ee/computedobject.py +10 -10
- ee/confusionmatrix.py +8 -8
- ee/customfunction.py +2 -2
- ee/data.py +15 -14
- ee/daterange.py +9 -9
- ee/deprecation.py +13 -11
- ee/deserializer.py +5 -5
- ee/dictionary.py +11 -11
- ee/ee_array.py +17 -17
- ee/ee_date.py +22 -22
- ee/ee_list.py +15 -15
- ee/ee_number.py +5 -5
- ee/ee_string.py +6 -6
- ee/ee_types.py +2 -2
- ee/element.py +14 -14
- ee/errormargin.py +3 -3
- ee/feature.py +67 -70
- ee/featurecollection.py +30 -32
- ee/filter.py +88 -90
- ee/function.py +3 -3
- ee/geometry.py +61 -62
- ee/image.py +216 -209
- ee/image_converter.py +2 -2
- ee/imagecollection.py +23 -20
- ee/join.py +13 -15
- ee/kernel.py +55 -57
- ee/oauth.py +26 -20
- ee/pixeltype.py +5 -5
- ee/projection.py +4 -3
- ee/reducer.py +39 -41
- ee/serializer.py +4 -4
- ee/table_converter.py +3 -2
- ee/terrain.py +6 -8
- ee/tests/_cloud_api_utils_test.py +1 -1
- ee/tests/_helpers_test.py +1 -1
- ee/tests/batch_test.py +1 -1
- ee/tests/data_test.py +2 -2
- ee/tests/ee_test.py +3 -3
- ee/tests/errormargin_test.py +1 -1
- ee/tests/image_converter_test.py +2 -2
- ee/tests/pixeltype_test.py +1 -2
- ee/tests/projection_test.py +2 -3
- ee/tests/table_converter_test.py +2 -2
- earthengine_api-1.5.24.dist-info/RECORD +0 -107
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/WHEEL +0 -0
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/entry_points.txt +0 -0
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/licenses/LICENSE +0 -0
- {earthengine_api-1.5.24.dist-info → earthengine_api-1.6.0.dist-info}/top_level.txt +0 -0
ee/geometry.py
CHANGED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import collections.abc
|
|
6
|
+
from collections.abc import Sequence
|
|
6
7
|
import json
|
|
7
8
|
import math
|
|
8
|
-
from typing import Any
|
|
9
|
+
from typing import Any
|
|
9
10
|
|
|
10
11
|
from ee import _arg_types
|
|
11
12
|
from ee import _utils
|
|
@@ -36,10 +37,10 @@ class Geometry(computedobject.ComputedObject):
|
|
|
36
37
|
@_utils.accept_opt_prefix('opt_proj', 'opt_geodesic', 'opt_evenOdd')
|
|
37
38
|
def __init__(
|
|
38
39
|
self,
|
|
39
|
-
geo_json:
|
|
40
|
-
proj:
|
|
41
|
-
geodesic:
|
|
42
|
-
evenOdd:
|
|
40
|
+
geo_json: dict[str, Any] | computedobject.ComputedObject | Geometry,
|
|
41
|
+
proj: Any | None = None,
|
|
42
|
+
geodesic: bool | None = None,
|
|
43
|
+
evenOdd: bool | None = None, # pylint: disable=g-bad-name
|
|
43
44
|
):
|
|
44
45
|
"""Creates a geometry.
|
|
45
46
|
|
|
@@ -296,10 +297,10 @@ class Geometry(computedobject.ComputedObject):
|
|
|
296
297
|
|
|
297
298
|
@staticmethod
|
|
298
299
|
def BBox(
|
|
299
|
-
west:
|
|
300
|
-
south:
|
|
301
|
-
east:
|
|
302
|
-
north:
|
|
300
|
+
west: float | computedobject.ComputedObject,
|
|
301
|
+
south: float | computedobject.ComputedObject,
|
|
302
|
+
east: float | computedobject.ComputedObject,
|
|
303
|
+
north: float | computedobject.ComputedObject,
|
|
303
304
|
) -> Geometry:
|
|
304
305
|
"""Constructs a rectangle ee.Geometry from lines of latitude and longitude.
|
|
305
306
|
|
|
@@ -333,11 +334,9 @@ class Geometry(computedobject.ComputedObject):
|
|
|
333
334
|
# support the general idea of an around-the-globe latitude band. By writing
|
|
334
335
|
# them negated, we also reject NaN.
|
|
335
336
|
if not west < math.inf:
|
|
336
|
-
raise ee_exception.EEException(
|
|
337
|
-
'Geometry.BBox: west must not be {}'.format(west))
|
|
337
|
+
raise ee_exception.EEException(f'Geometry.BBox: west must not be {west}')
|
|
338
338
|
if not east > -math.inf:
|
|
339
|
-
raise ee_exception.EEException(
|
|
340
|
-
'Geometry.BBox: east must not be {}'.format(east))
|
|
339
|
+
raise ee_exception.EEException(f'Geometry.BBox: east must not be {east}')
|
|
341
340
|
# Reject cases which, if we clamped them instead, would move a box whose
|
|
342
341
|
# bounds lie entirely "past" a pole to being at the pole. By writing them
|
|
343
342
|
# negated, we also reject NaN.
|
|
@@ -600,7 +599,7 @@ class Geometry(computedobject.ComputedObject):
|
|
|
600
599
|
return Geometry(Geometry._parseArgs('MultiPolygon', 4, all_args))
|
|
601
600
|
|
|
602
601
|
@_utils.accept_opt_prefix('opt_encoder')
|
|
603
|
-
def encode(self, encoder:
|
|
602
|
+
def encode(self, encoder: Any | None = None) -> dict[str, Any]:
|
|
604
603
|
"""Returns a GeoJSON-compatible representation of the geometry."""
|
|
605
604
|
if not getattr(self, '_type', None):
|
|
606
605
|
return super().encode(encoder)
|
|
@@ -694,7 +693,7 @@ class Geometry(computedobject.ComputedObject):
|
|
|
694
693
|
(nesting == 4 or not coords)))
|
|
695
694
|
|
|
696
695
|
@staticmethod
|
|
697
|
-
def _isValidCoordinates(shape:
|
|
696
|
+
def _isValidCoordinates(shape: Sequence[float] | Geometry) -> int:
|
|
698
697
|
"""Validate the coordinates of a geometry.
|
|
699
698
|
|
|
700
699
|
Args:
|
|
@@ -886,8 +885,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
886
885
|
def area(
|
|
887
886
|
self,
|
|
888
887
|
# pylint: disable-next=invalid-name
|
|
889
|
-
maxError:
|
|
890
|
-
proj:
|
|
888
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
889
|
+
proj: _arg_types.Projection | None = None,
|
|
891
890
|
) -> ee_number.Number:
|
|
892
891
|
"""Returns the area of the geometry.
|
|
893
892
|
|
|
@@ -909,8 +908,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
909
908
|
def bounds(
|
|
910
909
|
self,
|
|
911
910
|
# pylint: disable-next=invalid-name
|
|
912
|
-
maxError:
|
|
913
|
-
proj:
|
|
911
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
912
|
+
proj: _arg_types.Projection | None = None,
|
|
914
913
|
) -> Geometry:
|
|
915
914
|
"""Returns the bounding rectangle of the geometry.
|
|
916
915
|
|
|
@@ -929,8 +928,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
929
928
|
self,
|
|
930
929
|
distance: _arg_types.Number,
|
|
931
930
|
# pylint: disable-next=invalid-name
|
|
932
|
-
maxError:
|
|
933
|
-
proj:
|
|
931
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
932
|
+
proj: _arg_types.Projection | None = None,
|
|
934
933
|
) -> Geometry:
|
|
935
934
|
"""Returns the input buffered by a given distance.
|
|
936
935
|
|
|
@@ -957,8 +956,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
957
956
|
def centroid(
|
|
958
957
|
self,
|
|
959
958
|
# pylint: disable-next=invalid-name
|
|
960
|
-
maxError:
|
|
961
|
-
proj:
|
|
959
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
960
|
+
proj: _arg_types.Projection | None = None,
|
|
962
961
|
) -> Geometry:
|
|
963
962
|
"""Returns a point at the center of the highest-dimension components.
|
|
964
963
|
|
|
@@ -981,8 +980,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
981
980
|
self,
|
|
982
981
|
right: _arg_types.Geometry,
|
|
983
982
|
# pylint: disable-next=invalid-name
|
|
984
|
-
maxError:
|
|
985
|
-
proj:
|
|
983
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
984
|
+
proj: _arg_types.Projection | None = None,
|
|
986
985
|
) -> computedobject.ComputedObject:
|
|
987
986
|
"""Returns the point on the right input that is nearest to the left input.
|
|
988
987
|
|
|
@@ -1010,8 +1009,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1010
1009
|
self,
|
|
1011
1010
|
right: _arg_types.Geometry,
|
|
1012
1011
|
# pylint: disable-next=invalid-name
|
|
1013
|
-
maxError:
|
|
1014
|
-
proj:
|
|
1012
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1013
|
+
proj: _arg_types.Projection | None = None,
|
|
1015
1014
|
) -> computedobject.ComputedObject:
|
|
1016
1015
|
"""Returns the points on the right input that are nearest to the left input.
|
|
1017
1016
|
|
|
@@ -1042,8 +1041,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1042
1041
|
self,
|
|
1043
1042
|
right: _arg_types.Geometry,
|
|
1044
1043
|
# pylint: disable-next=invalid-name
|
|
1045
|
-
maxError:
|
|
1046
|
-
proj:
|
|
1044
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1045
|
+
proj: _arg_types.Projection | None = None,
|
|
1047
1046
|
) -> computedobject.ComputedObject:
|
|
1048
1047
|
"""Returns true if and only if one geometry is contained in the other.
|
|
1049
1048
|
|
|
@@ -1067,8 +1066,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1067
1066
|
self,
|
|
1068
1067
|
right: _arg_types.Geometry,
|
|
1069
1068
|
# pylint: disable-next=invalid-name
|
|
1070
|
-
maxError:
|
|
1071
|
-
proj:
|
|
1069
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1070
|
+
proj: _arg_types.Projection | None = None,
|
|
1072
1071
|
) -> computedobject.ComputedObject:
|
|
1073
1072
|
"""Returns true if and only if one geometry contains the other.
|
|
1074
1073
|
|
|
@@ -1091,8 +1090,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1091
1090
|
def convexHull(
|
|
1092
1091
|
self,
|
|
1093
1092
|
# pylint: disable-next=invalid-name
|
|
1094
|
-
maxError:
|
|
1095
|
-
proj:
|
|
1093
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1094
|
+
proj: _arg_types.Projection | None = None,
|
|
1096
1095
|
) -> Geometry:
|
|
1097
1096
|
"""Returns the convex hull of the given geometry.
|
|
1098
1097
|
|
|
@@ -1121,7 +1120,7 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1121
1120
|
def coveringGrid(
|
|
1122
1121
|
self,
|
|
1123
1122
|
proj: _arg_types.Projection,
|
|
1124
|
-
scale:
|
|
1123
|
+
scale: _arg_types.Number | None = None,
|
|
1125
1124
|
) -> featurecollection.FeatureCollection:
|
|
1126
1125
|
"""Returns a collection of features that cover this geometry.
|
|
1127
1126
|
|
|
@@ -1145,8 +1144,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1145
1144
|
self,
|
|
1146
1145
|
distances: _arg_types.List,
|
|
1147
1146
|
# pylint: disable-next=invalid-name
|
|
1148
|
-
maxError:
|
|
1149
|
-
proj:
|
|
1147
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1148
|
+
proj: _arg_types.Projection | None = None,
|
|
1150
1149
|
) -> Geometry:
|
|
1151
1150
|
"""Returns geometries cut into pieces along the given distances.
|
|
1152
1151
|
|
|
@@ -1173,8 +1172,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1173
1172
|
self,
|
|
1174
1173
|
right: _arg_types.Geometry,
|
|
1175
1174
|
# pylint: disable-next=invalid-name
|
|
1176
|
-
maxError:
|
|
1177
|
-
proj:
|
|
1175
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1176
|
+
proj: _arg_types.Projection | None = None,
|
|
1178
1177
|
) -> Geometry:
|
|
1179
1178
|
"""Returns the result of subtracting the 'right' geometry from the geometry.
|
|
1180
1179
|
|
|
@@ -1195,8 +1194,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1195
1194
|
self,
|
|
1196
1195
|
right: _arg_types.Geometry,
|
|
1197
1196
|
# pylint: disable-next=invalid-name
|
|
1198
|
-
maxError:
|
|
1199
|
-
proj:
|
|
1197
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1198
|
+
proj: _arg_types.Projection | None = None,
|
|
1200
1199
|
) -> computedobject.ComputedObject:
|
|
1201
1200
|
"""Returns true if and only if the geometries are disjoint.
|
|
1202
1201
|
|
|
@@ -1219,8 +1218,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1219
1218
|
def dissolve(
|
|
1220
1219
|
self,
|
|
1221
1220
|
# pylint: disable-next=invalid-name
|
|
1222
|
-
maxError:
|
|
1223
|
-
proj:
|
|
1221
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1222
|
+
proj: _arg_types.Projection | None = None,
|
|
1224
1223
|
) -> Geometry:
|
|
1225
1224
|
"""Returns the union of the geometry.
|
|
1226
1225
|
|
|
@@ -1241,9 +1240,9 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1241
1240
|
self,
|
|
1242
1241
|
right: _arg_types.Geometry,
|
|
1243
1242
|
# pylint: disable-next=invalid-name
|
|
1244
|
-
maxError:
|
|
1245
|
-
proj:
|
|
1246
|
-
spherical:
|
|
1243
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1244
|
+
proj: _arg_types.Projection | None = None,
|
|
1245
|
+
spherical: _arg_types.Bool | None = None,
|
|
1247
1246
|
) -> ee_number.Number:
|
|
1248
1247
|
"""Returns the minimum distance between two geometries.
|
|
1249
1248
|
|
|
@@ -1325,8 +1324,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1325
1324
|
self,
|
|
1326
1325
|
right: _arg_types.Geometry,
|
|
1327
1326
|
# pylint: disable-next=invalid-name
|
|
1328
|
-
maxError:
|
|
1329
|
-
proj:
|
|
1327
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1328
|
+
proj: _arg_types.Projection | None = None,
|
|
1330
1329
|
) -> Geometry:
|
|
1331
1330
|
"""Returns the intersection of the two geometries.
|
|
1332
1331
|
|
|
@@ -1347,8 +1346,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1347
1346
|
self,
|
|
1348
1347
|
right: _arg_types.Geometry,
|
|
1349
1348
|
# pylint: disable-next=invalid-name
|
|
1350
|
-
maxError:
|
|
1351
|
-
proj:
|
|
1349
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1350
|
+
proj: _arg_types.Projection | None = None,
|
|
1352
1351
|
) -> computedobject.ComputedObject:
|
|
1353
1352
|
"""Returns true if and only if the geometries intersect.
|
|
1354
1353
|
|
|
@@ -1376,8 +1375,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1376
1375
|
def length(
|
|
1377
1376
|
self,
|
|
1378
1377
|
# pylint: disable-next=invalid-name
|
|
1379
|
-
maxError:
|
|
1380
|
-
proj:
|
|
1378
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1379
|
+
proj: _arg_types.Projection | None = None,
|
|
1381
1380
|
) -> ee_number.Number:
|
|
1382
1381
|
"""Returns the length of the linear parts of the geometry.
|
|
1383
1382
|
|
|
@@ -1398,8 +1397,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1398
1397
|
def perimeter(
|
|
1399
1398
|
self,
|
|
1400
1399
|
# pylint: disable-next=invalid-name
|
|
1401
|
-
maxError:
|
|
1402
|
-
proj:
|
|
1400
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1401
|
+
proj: _arg_types.Projection | None = None,
|
|
1403
1402
|
) -> ee_number.Number:
|
|
1404
1403
|
"""Returns the perimeter length of the polygonal parts of the geometry.
|
|
1405
1404
|
|
|
@@ -1436,7 +1435,7 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1436
1435
|
def simplify(
|
|
1437
1436
|
self,
|
|
1438
1437
|
maxError: _arg_types.ErrorMargin, # pylint: disable=invalid-name
|
|
1439
|
-
proj:
|
|
1438
|
+
proj: _arg_types.Projection | None = None,
|
|
1440
1439
|
) -> Geometry:
|
|
1441
1440
|
"""Returns a simplified geometry to within a given error margin.
|
|
1442
1441
|
|
|
@@ -1467,8 +1466,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1467
1466
|
self,
|
|
1468
1467
|
right: _arg_types.Geometry,
|
|
1469
1468
|
# pylint: disable-next=invalid-name
|
|
1470
|
-
maxError:
|
|
1471
|
-
proj:
|
|
1469
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1470
|
+
proj: _arg_types.Projection | None = None,
|
|
1472
1471
|
) -> Geometry:
|
|
1473
1472
|
"""Returns the symmetric difference between two geometries.
|
|
1474
1473
|
|
|
@@ -1487,9 +1486,9 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1487
1486
|
|
|
1488
1487
|
def transform(
|
|
1489
1488
|
self,
|
|
1490
|
-
proj:
|
|
1489
|
+
proj: _arg_types.Projection | None = None,
|
|
1491
1490
|
# pylint: disable-next=invalid-name
|
|
1492
|
-
maxError:
|
|
1491
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1493
1492
|
) -> Geometry:
|
|
1494
1493
|
"""Returns the geometry Transformed to a specific projection.
|
|
1495
1494
|
|
|
@@ -1514,8 +1513,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1514
1513
|
self,
|
|
1515
1514
|
right: _arg_types.Geometry,
|
|
1516
1515
|
# pylint: disable-next=invalid-name
|
|
1517
|
-
maxError:
|
|
1518
|
-
proj:
|
|
1516
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1517
|
+
proj: _arg_types.Projection | None = None,
|
|
1519
1518
|
) -> Geometry:
|
|
1520
1519
|
"""Returns the union of the two geometries.
|
|
1521
1520
|
|
|
@@ -1537,8 +1536,8 @@ class Geometry(computedobject.ComputedObject):
|
|
|
1537
1536
|
right: _arg_types.Geometry,
|
|
1538
1537
|
distance: _arg_types.Number,
|
|
1539
1538
|
# pylint: disable-next=invalid-name
|
|
1540
|
-
maxError:
|
|
1541
|
-
proj:
|
|
1539
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
1540
|
+
proj: _arg_types.Projection | None = None,
|
|
1542
1541
|
) -> computedobject.ComputedObject:
|
|
1543
1542
|
"""Returns true if the geometries are within a specified distance.
|
|
1544
1543
|
|