earthengine-api 1.5.13rc0__py3-none-any.whl → 1.7.4__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.13rc0.dist-info → earthengine_api-1.7.4.dist-info}/METADATA +3 -3
- earthengine_api-1.7.4.dist-info/RECORD +109 -0
- {earthengine_api-1.5.13rc0.dist-info → earthengine_api-1.7.4.dist-info}/WHEEL +1 -1
- ee/__init__.py +29 -28
- ee/_arg_types.py +7 -6
- ee/_cloud_api_utils.py +95 -78
- ee/_helpers.py +17 -13
- ee/_state.py +105 -0
- ee/_utils.py +2 -1
- ee/apifunction.py +21 -19
- ee/apitestcase.py +33 -38
- ee/batch.py +87 -77
- ee/blob.py +10 -12
- ee/classifier.py +57 -59
- ee/cli/commands.py +178 -114
- ee/cli/eecli.py +1 -1
- ee/cli/utils.py +61 -42
- ee/clusterer.py +39 -41
- ee/collection.py +64 -54
- ee/computedobject.py +19 -16
- ee/confusionmatrix.py +9 -9
- ee/customfunction.py +13 -12
- ee/data.py +220 -322
- ee/daterange.py +10 -10
- ee/deprecation.py +21 -13
- ee/deserializer.py +25 -20
- ee/dictionary.py +11 -11
- ee/ee_array.py +22 -20
- ee/ee_date.py +23 -23
- ee/ee_list.py +15 -16
- ee/ee_number.py +11 -21
- ee/ee_string.py +24 -32
- ee/ee_types.py +4 -4
- ee/element.py +15 -15
- ee/encodable.py +7 -4
- ee/errormargin.py +4 -4
- ee/feature.py +68 -71
- ee/featurecollection.py +41 -40
- ee/filter.py +90 -92
- ee/function.py +8 -8
- ee/geometry.py +95 -93
- ee/image.py +238 -236
- ee/image_converter.py +4 -4
- ee/imagecollection.py +30 -27
- ee/join.py +13 -15
- ee/kernel.py +55 -57
- ee/mapclient.py +9 -9
- ee/model.py +29 -31
- ee/oauth.py +76 -63
- ee/pixeltype.py +6 -6
- ee/projection.py +5 -4
- ee/reducer.py +41 -41
- ee/serializer.py +14 -14
- ee/table_converter.py +7 -6
- ee/terrain.py +7 -9
- ee/tests/_cloud_api_utils_test.py +21 -6
- ee/tests/_helpers_test.py +57 -4
- ee/tests/_state_test.py +49 -0
- ee/tests/algorithms.json +85 -2
- ee/tests/apifunction_test.py +5 -5
- ee/tests/batch_test.py +135 -57
- ee/tests/blob_test.py +5 -5
- ee/tests/classifier_test.py +3 -3
- ee/tests/clusterer_test.py +3 -3
- ee/tests/collection_test.py +48 -13
- ee/tests/confusionmatrix_test.py +3 -3
- ee/tests/data_test.py +484 -55
- ee/tests/daterange_test.py +4 -4
- ee/tests/deprecation_test.py +6 -4
- ee/tests/deserializer_test.py +64 -5
- ee/tests/dictionary_test.py +12 -12
- ee/tests/ee_array_test.py +3 -3
- ee/tests/ee_date_test.py +4 -4
- ee/tests/ee_list_test.py +3 -3
- ee/tests/ee_number_test.py +75 -30
- ee/tests/ee_string_test.py +11 -3
- ee/tests/ee_test.py +40 -22
- ee/tests/element_test.py +2 -2
- ee/tests/errormargin_test.py +1 -1
- ee/tests/feature_test.py +10 -10
- ee/tests/featurecollection_test.py +3 -3
- ee/tests/filter_test.py +4 -4
- ee/tests/function_test.py +5 -5
- ee/tests/geometry_point_test.py +3 -3
- ee/tests/geometry_test.py +93 -52
- ee/tests/image_converter_test.py +1 -3
- ee/tests/image_test.py +3 -3
- ee/tests/imagecollection_test.py +3 -3
- ee/tests/join_test.py +3 -3
- ee/tests/kernel_test.py +7 -3
- ee/tests/model_test.py +17 -5
- ee/tests/oauth_test.py +189 -7
- ee/tests/pixeltype_test.py +6 -7
- ee/tests/projection_test.py +5 -6
- ee/tests/reducer_test.py +16 -3
- ee/tests/serializer_test.py +39 -12
- ee/tests/table_converter_test.py +51 -7
- ee/tests/terrain_test.py +11 -3
- earthengine_api-1.5.13rc0.dist-info/RECORD +0 -107
- {earthengine_api-1.5.13rc0.dist-info → earthengine_api-1.7.4.dist-info}/entry_points.txt +0 -0
- {earthengine_api-1.5.13rc0.dist-info → earthengine_api-1.7.4.dist-info}/licenses/LICENSE +0 -0
- {earthengine_api-1.5.13rc0.dist-info → earthengine_api-1.7.4.dist-info}/top_level.txt +0 -0
ee/image.py
CHANGED
|
@@ -6,8 +6,9 @@ details.
|
|
|
6
6
|
|
|
7
7
|
from __future__ import annotations
|
|
8
8
|
|
|
9
|
+
from collections.abc import Sequence
|
|
9
10
|
import json
|
|
10
|
-
from typing import Any
|
|
11
|
+
from typing import Any
|
|
11
12
|
|
|
12
13
|
from ee import _arg_types
|
|
13
14
|
from ee import _utils
|
|
@@ -39,8 +40,7 @@ def _parse_dimensions(dimensions: Any) -> Sequence[Any]:
|
|
|
39
40
|
elif isinstance(dimensions, (list, tuple)) and 1 <= len(dimensions) <= 2:
|
|
40
41
|
return dimensions
|
|
41
42
|
|
|
42
|
-
raise ee_exception.EEException(
|
|
43
|
-
'Invalid dimensions {}.'.format(dimensions))
|
|
43
|
+
raise ee_exception.EEException(f'Invalid dimensions {dimensions}.')
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class Image(element.Element):
|
|
@@ -52,9 +52,7 @@ class Image(element.Element):
|
|
|
52
52
|
_HAS_DYNAMIC_ATTRIBUTES = True
|
|
53
53
|
|
|
54
54
|
@deprecation.WarnForDeprecatedAsset('args')
|
|
55
|
-
def __init__(
|
|
56
|
-
self, args: Optional[Any] = None, version: Optional[float] = None
|
|
57
|
-
):
|
|
55
|
+
def __init__(self, args: Any | None = None, version: float | None = None):
|
|
58
56
|
"""Constructs an Earth Engine image.
|
|
59
57
|
|
|
60
58
|
Args:
|
|
@@ -132,7 +130,7 @@ class Image(element.Element):
|
|
|
132
130
|
return 'Image'
|
|
133
131
|
|
|
134
132
|
# pylint: disable-next=useless-parent-delegation
|
|
135
|
-
def getInfo(self) ->
|
|
133
|
+
def getInfo(self) -> Any | None:
|
|
136
134
|
"""Fetch and return information about this image.
|
|
137
135
|
|
|
138
136
|
Returns:
|
|
@@ -142,7 +140,7 @@ class Image(element.Element):
|
|
|
142
140
|
"""
|
|
143
141
|
return super().getInfo()
|
|
144
142
|
|
|
145
|
-
def getMapId(self, vis_params:
|
|
143
|
+
def getMapId(self, vis_params: Any | None = None) -> dict[str, Any]:
|
|
146
144
|
"""Fetch and return a map ID dictionary, suitable for use in a Map overlay.
|
|
147
145
|
|
|
148
146
|
Args:
|
|
@@ -158,8 +156,8 @@ class Image(element.Element):
|
|
|
158
156
|
return response
|
|
159
157
|
|
|
160
158
|
def _apply_crs_and_affine(
|
|
161
|
-
self, params:
|
|
162
|
-
) ->
|
|
159
|
+
self, params: dict[str, Any]
|
|
160
|
+
) -> tuple[Any, Any, Any]:
|
|
163
161
|
"""Applies any CRS and affine parameters to an image.
|
|
164
162
|
|
|
165
163
|
Wraps the image in a call to Reproject() if the request includes
|
|
@@ -175,7 +173,7 @@ class Image(element.Element):
|
|
|
175
173
|
- whether dimensions had originally been specified, but were merged
|
|
176
174
|
into the image.
|
|
177
175
|
"""
|
|
178
|
-
keys_to_extract =
|
|
176
|
+
keys_to_extract = {'crs', 'crs_transform', 'crsTransform'}
|
|
179
177
|
request = {}
|
|
180
178
|
reprojection_params = {}
|
|
181
179
|
dimensions_consumed = False
|
|
@@ -246,8 +244,8 @@ class Image(element.Element):
|
|
|
246
244
|
return image, request, dimensions_consumed
|
|
247
245
|
|
|
248
246
|
def _apply_selection_and_scale(
|
|
249
|
-
self, params:
|
|
250
|
-
) ->
|
|
247
|
+
self, params: dict[str, Any], dimensions_consumed: bool
|
|
248
|
+
) -> tuple[Any, dict[str, Any]]:
|
|
251
249
|
"""Applies region selection and scaling parameters to an image.
|
|
252
250
|
|
|
253
251
|
Wraps the image in a call to clipToBoundsAndScale() if there are any
|
|
@@ -264,10 +262,10 @@ class Image(element.Element):
|
|
|
264
262
|
image
|
|
265
263
|
- any remaining (non-selection/scale) parameters.
|
|
266
264
|
"""
|
|
267
|
-
keys_to_extract =
|
|
265
|
+
keys_to_extract = {'region', 'dimensions', 'scale'}
|
|
268
266
|
scale_keys = ['maxDimension', 'height', 'width', 'scale']
|
|
269
|
-
request:
|
|
270
|
-
selection_params:
|
|
267
|
+
request: dict[str, Any] = {}
|
|
268
|
+
selection_params: dict[str, Any] = {}
|
|
271
269
|
if params:
|
|
272
270
|
for key in params:
|
|
273
271
|
if key not in keys_to_extract:
|
|
@@ -322,8 +320,8 @@ class Image(element.Element):
|
|
|
322
320
|
return image, request
|
|
323
321
|
|
|
324
322
|
def _apply_spatial_transformations(
|
|
325
|
-
self, params:
|
|
326
|
-
) ->
|
|
323
|
+
self, params: dict[str, Any]
|
|
324
|
+
) -> tuple[Any, dict[str, Any]]:
|
|
327
325
|
"""Applies spatial transformation and clipping.
|
|
328
326
|
|
|
329
327
|
Args:
|
|
@@ -340,8 +338,8 @@ class Image(element.Element):
|
|
|
340
338
|
return image._apply_selection_and_scale(params, dimensions_consumed)
|
|
341
339
|
|
|
342
340
|
def _apply_visualization(
|
|
343
|
-
self, params:
|
|
344
|
-
) ->
|
|
341
|
+
self, params: dict[str, Any]
|
|
342
|
+
) -> tuple[Any, dict[str, Any]]:
|
|
345
343
|
"""Applies visualization parameters to an image.
|
|
346
344
|
|
|
347
345
|
Wraps the image in a call to visualize() if there are any recognized
|
|
@@ -357,8 +355,17 @@ class Image(element.Element):
|
|
|
357
355
|
"""
|
|
358
356
|
# Split the parameters into those handled handled by visualize()
|
|
359
357
|
# and those that aren't.
|
|
360
|
-
keys_to_extract =
|
|
361
|
-
|
|
358
|
+
keys_to_extract = {
|
|
359
|
+
'bands',
|
|
360
|
+
'gain',
|
|
361
|
+
'bias',
|
|
362
|
+
'min',
|
|
363
|
+
'max',
|
|
364
|
+
'gamma',
|
|
365
|
+
'palette',
|
|
366
|
+
'opacity',
|
|
367
|
+
'forceRgbOutput',
|
|
368
|
+
}
|
|
362
369
|
request = {}
|
|
363
370
|
vis_params = {}
|
|
364
371
|
if params:
|
|
@@ -373,7 +380,7 @@ class Image(element.Element):
|
|
|
373
380
|
image = apifunction.ApiFunction.apply_('Image.visualize', vis_params)
|
|
374
381
|
return image, request
|
|
375
382
|
|
|
376
|
-
def _build_download_id_image(self, params:
|
|
383
|
+
def _build_download_id_image(self, params: dict[str, Any]) -> Any:
|
|
377
384
|
"""Processes the getDownloadId parameters and returns the built image.
|
|
378
385
|
|
|
379
386
|
Given transformation parameters (crs, crs_transform, dimensions, scale, and
|
|
@@ -395,7 +402,7 @@ class Image(element.Element):
|
|
|
395
402
|
"""
|
|
396
403
|
params = params.copy()
|
|
397
404
|
|
|
398
|
-
def _extract_and_validate_transforms(obj:
|
|
405
|
+
def _extract_and_validate_transforms(obj: dict[str, Any]) -> dict[str, Any]:
|
|
399
406
|
"""Takes a parameter dictionary and extracts the transformation keys."""
|
|
400
407
|
extracted = {}
|
|
401
408
|
for key in ['crs', 'crs_transform', 'dimensions', 'region']:
|
|
@@ -407,7 +414,7 @@ class Image(element.Element):
|
|
|
407
414
|
extracted['scale'] = obj['scale']
|
|
408
415
|
return extracted
|
|
409
416
|
|
|
410
|
-
def _build_image_per_band(band_params:
|
|
417
|
+
def _build_image_per_band(band_params: dict[str, Any]) -> Any:
|
|
411
418
|
"""Takes a band dictionary and builds an image for it."""
|
|
412
419
|
if 'id' not in band_params:
|
|
413
420
|
raise ee_exception.EEException('Each band dictionary must have an id.')
|
|
@@ -423,8 +430,7 @@ class Image(element.Element):
|
|
|
423
430
|
# pylint: enable=protected-access
|
|
424
431
|
return band_image
|
|
425
432
|
|
|
426
|
-
if params['format'] == 'ZIPPED_GEO_TIFF_PER_BAND' and params.get(
|
|
427
|
-
'bands') and len(params.get('bands')):
|
|
433
|
+
if params['format'] == 'ZIPPED_GEO_TIFF_PER_BAND' and params.get('bands'):
|
|
428
434
|
# Build a new image based on the constituent band images.
|
|
429
435
|
image = Image.combine_(
|
|
430
436
|
[_build_image_per_band(band) for band in params['bands']])
|
|
@@ -435,7 +441,7 @@ class Image(element.Element):
|
|
|
435
441
|
del copy_params # Unused.
|
|
436
442
|
return image
|
|
437
443
|
|
|
438
|
-
def prepare_for_export(self, params:
|
|
444
|
+
def prepare_for_export(self, params: dict[str, Any]) -> Any:
|
|
439
445
|
"""Applies all relevant export parameters to an image.
|
|
440
446
|
|
|
441
447
|
Args:
|
|
@@ -449,7 +455,7 @@ class Image(element.Element):
|
|
|
449
455
|
"""
|
|
450
456
|
return self._apply_spatial_transformations(params)
|
|
451
457
|
|
|
452
|
-
def getDownloadURL(self, params:
|
|
458
|
+
def getDownloadURL(self, params: dict[str, Any] | None = None) -> str:
|
|
453
459
|
"""Get a download URL for an image chunk.
|
|
454
460
|
|
|
455
461
|
Generates a download URL for small chunks of image data in GeoTIFF or NumPy
|
|
@@ -509,7 +515,7 @@ class Image(element.Element):
|
|
|
509
515
|
request['image'] = self
|
|
510
516
|
return data.makeDownloadUrl(data.getDownloadId(request))
|
|
511
517
|
|
|
512
|
-
def getThumbId(self, params:
|
|
518
|
+
def getThumbId(self, params: dict[str, Any]) -> dict[str, str]:
|
|
513
519
|
"""Applies transformations and returns the thumbId.
|
|
514
520
|
|
|
515
521
|
Args:
|
|
@@ -534,7 +540,7 @@ class Image(element.Element):
|
|
|
534
540
|
params['image'] = image
|
|
535
541
|
return data.getThumbId(params)
|
|
536
542
|
|
|
537
|
-
def getThumbURL(self, params:
|
|
543
|
+
def getThumbURL(self, params: dict[str, Any] | None = None) -> str:
|
|
538
544
|
"""Get a thumbnail URL for this image.
|
|
539
545
|
|
|
540
546
|
Args:
|
|
@@ -609,7 +615,7 @@ class Image(element.Element):
|
|
|
609
615
|
return Image.combine_(args)
|
|
610
616
|
|
|
611
617
|
@staticmethod
|
|
612
|
-
def combine_(images: Any, names:
|
|
618
|
+
def combine_(images: Any, names: Any | None = None) -> Image:
|
|
613
619
|
"""Combine all the bands from the given images into a single image.
|
|
614
620
|
|
|
615
621
|
Args:
|
|
@@ -634,7 +640,7 @@ class Image(element.Element):
|
|
|
634
640
|
return result
|
|
635
641
|
|
|
636
642
|
@_utils.accept_opt_prefix(('opt_map', 'map_'))
|
|
637
|
-
def expression(self, expression: Any, map_:
|
|
643
|
+
def expression(self, expression: Any, map_: Any | None = None) -> Image:
|
|
638
644
|
"""Evaluates an arithmetic expression on an image or images.
|
|
639
645
|
|
|
640
646
|
The bands of the primary input image are available using the built-in
|
|
@@ -714,8 +720,8 @@ class Image(element.Element):
|
|
|
714
720
|
def addBands(
|
|
715
721
|
self,
|
|
716
722
|
srcImg: _arg_types.Image, # pylint: disable=invalid-name
|
|
717
|
-
names:
|
|
718
|
-
overwrite:
|
|
723
|
+
names: _arg_types.List | None = None,
|
|
724
|
+
overwrite: _arg_types.Bool | None = None,
|
|
719
725
|
) -> Image:
|
|
720
726
|
"""Returns an image containing all bands.
|
|
721
727
|
|
|
@@ -765,7 +771,7 @@ class Image(element.Element):
|
|
|
765
771
|
def arrayAccum(
|
|
766
772
|
self,
|
|
767
773
|
axis: _arg_types.Integer,
|
|
768
|
-
reducer:
|
|
774
|
+
reducer: _arg_types.Reducer | None = None,
|
|
769
775
|
) -> Image:
|
|
770
776
|
"""Accumulates elements of each array pixel along the given axis.
|
|
771
777
|
|
|
@@ -847,7 +853,7 @@ class Image(element.Element):
|
|
|
847
853
|
def arrayFlatten(
|
|
848
854
|
self,
|
|
849
855
|
coordinateLabels: _arg_types.List, # pylint: disable=invalid-name
|
|
850
|
-
separator:
|
|
856
|
+
separator: _arg_types.String | None = None,
|
|
851
857
|
) -> Image:
|
|
852
858
|
"""Returns an image of scalar pixels with one band per element of the array.
|
|
853
859
|
|
|
@@ -926,7 +932,7 @@ class Image(element.Element):
|
|
|
926
932
|
return apifunction.ApiFunction.call_(self.name() + '.arrayMask', self, mask)
|
|
927
933
|
|
|
928
934
|
def arrayPad(
|
|
929
|
-
self, lengths: _arg_types.List, pad:
|
|
935
|
+
self, lengths: _arg_types.List, pad: _arg_types.Number | None = None
|
|
930
936
|
) -> Image:
|
|
931
937
|
"""Pads the array values in each pixel to be a fixed length.
|
|
932
938
|
|
|
@@ -973,7 +979,7 @@ class Image(element.Element):
|
|
|
973
979
|
reducer: _arg_types.Any,
|
|
974
980
|
axes: _arg_types.Any,
|
|
975
981
|
# pylint: disable-next=invalid-name
|
|
976
|
-
fieldAxis:
|
|
982
|
+
fieldAxis: _arg_types.Integer | None = None,
|
|
977
983
|
) -> Image:
|
|
978
984
|
"""Reduces elements of each array pixel.
|
|
979
985
|
|
|
@@ -1036,10 +1042,10 @@ class Image(element.Element):
|
|
|
1036
1042
|
|
|
1037
1043
|
def arraySlice(
|
|
1038
1044
|
self,
|
|
1039
|
-
axis:
|
|
1040
|
-
start:
|
|
1041
|
-
end:
|
|
1042
|
-
step:
|
|
1045
|
+
axis: _arg_types.Integer | None = None,
|
|
1046
|
+
start: _arg_types.Any | None = None,
|
|
1047
|
+
end: _arg_types.Any | None = None,
|
|
1048
|
+
step: _arg_types.Integer | None = None,
|
|
1043
1049
|
) -> Image:
|
|
1044
1050
|
"""Returns a subarray image.
|
|
1045
1051
|
|
|
@@ -1078,7 +1084,7 @@ class Image(element.Element):
|
|
|
1078
1084
|
self.name() + '.arraySlice', self, axis, start, end, step
|
|
1079
1085
|
)
|
|
1080
1086
|
|
|
1081
|
-
def arraySort(self, keys:
|
|
1087
|
+
def arraySort(self, keys: _arg_types.Any | None = None) -> Image:
|
|
1082
1088
|
"""Sorts elements of each array pixel along one axis.
|
|
1083
1089
|
|
|
1084
1090
|
Args:
|
|
@@ -1094,8 +1100,8 @@ class Image(element.Element):
|
|
|
1094
1100
|
|
|
1095
1101
|
def arrayTranspose(
|
|
1096
1102
|
self,
|
|
1097
|
-
axis1:
|
|
1098
|
-
axis2:
|
|
1103
|
+
axis1: _arg_types.Integer | None = None,
|
|
1104
|
+
axis2: _arg_types.Integer | None = None,
|
|
1099
1105
|
) -> Image:
|
|
1100
1106
|
"""Transposes two dimensions of each array pixel.
|
|
1101
1107
|
|
|
@@ -1268,7 +1274,7 @@ class Image(element.Element):
|
|
|
1268
1274
|
self,
|
|
1269
1275
|
# pylint: disable=invalid-name
|
|
1270
1276
|
bandTypes: _arg_types.Dictionary,
|
|
1271
|
-
bandOrder:
|
|
1277
|
+
bandOrder: _arg_types.Any | None = None,
|
|
1272
1278
|
# pylint: enable=invalid-name
|
|
1273
1279
|
) -> Image:
|
|
1274
1280
|
"""Casts some or all bands of an image to the specified types.
|
|
@@ -1342,7 +1348,7 @@ class Image(element.Element):
|
|
|
1342
1348
|
self,
|
|
1343
1349
|
classifier: _arg_types.Classifier,
|
|
1344
1350
|
# pylint: disable-next=invalid-name
|
|
1345
|
-
outputName:
|
|
1351
|
+
outputName: _arg_types.String | None = None,
|
|
1346
1352
|
) -> Image:
|
|
1347
1353
|
"""Classifies an image.
|
|
1348
1354
|
|
|
@@ -1387,12 +1393,12 @@ class Image(element.Element):
|
|
|
1387
1393
|
|
|
1388
1394
|
def clipToBoundsAndScale(
|
|
1389
1395
|
self,
|
|
1390
|
-
geometry:
|
|
1391
|
-
width:
|
|
1392
|
-
height:
|
|
1396
|
+
geometry: _arg_types.Geometry | None = None,
|
|
1397
|
+
width: _arg_types.Integer | None = None,
|
|
1398
|
+
height: _arg_types.Integer | None = None,
|
|
1393
1399
|
# pylint: disable-next=invalid-name
|
|
1394
|
-
maxDimension:
|
|
1395
|
-
scale:
|
|
1400
|
+
maxDimension: _arg_types.Integer | None = None,
|
|
1401
|
+
scale: _arg_types.Number | None = None,
|
|
1396
1402
|
) -> Image:
|
|
1397
1403
|
"""Returns an image clipped to a geometry and scaled.
|
|
1398
1404
|
|
|
@@ -1450,7 +1456,7 @@ class Image(element.Element):
|
|
|
1450
1456
|
self,
|
|
1451
1457
|
clusterer: _arg_types.Clusterer,
|
|
1452
1458
|
# pylint: disable-next=invalid-name
|
|
1453
|
-
outputName:
|
|
1459
|
+
outputName: _arg_types.String | None = None,
|
|
1454
1460
|
) -> Image:
|
|
1455
1461
|
"""Applies a clusterer to an image.
|
|
1456
1462
|
|
|
@@ -1494,8 +1500,8 @@ class Image(element.Element):
|
|
|
1494
1500
|
def connectedPixelCount(
|
|
1495
1501
|
self,
|
|
1496
1502
|
# pylint: disable=invalid-name
|
|
1497
|
-
maxSize:
|
|
1498
|
-
eightConnected:
|
|
1503
|
+
maxSize: _arg_types.Integer | None = None,
|
|
1504
|
+
eightConnected: _arg_types.Bool | None = None,
|
|
1499
1505
|
# pylint: enable=invalid-name
|
|
1500
1506
|
) -> Image:
|
|
1501
1507
|
"""Returns an ee.Image with the number of connected neighbors.
|
|
@@ -1544,8 +1550,8 @@ class Image(element.Element):
|
|
|
1544
1550
|
def copyProperties(
|
|
1545
1551
|
self,
|
|
1546
1552
|
source: _arg_types.Element,
|
|
1547
|
-
properties:
|
|
1548
|
-
exclude:
|
|
1553
|
+
properties: _arg_types.List | None = None,
|
|
1554
|
+
exclude: _arg_types.List | None = None,
|
|
1549
1555
|
) -> Image:
|
|
1550
1556
|
"""Copies metadata properties from one element to another.
|
|
1551
1557
|
|
|
@@ -1579,7 +1585,7 @@ class Image(element.Element):
|
|
|
1579
1585
|
source: _arg_types.Any,
|
|
1580
1586
|
# pylint: disable=invalid-name
|
|
1581
1587
|
maxDistance: _arg_types.Number,
|
|
1582
|
-
geodeticDistance:
|
|
1588
|
+
geodeticDistance: _arg_types.Bool | None = None,
|
|
1583
1589
|
# pylint: enable=invalid-name
|
|
1584
1590
|
) -> Image:
|
|
1585
1591
|
"""Returns an ee.Image with the cumulative cost map.
|
|
@@ -1639,7 +1645,7 @@ class Image(element.Element):
|
|
|
1639
1645
|
angle: _arg_types.Number,
|
|
1640
1646
|
# pylint: disable=invalid-name
|
|
1641
1647
|
maxDistance: _arg_types.Integer,
|
|
1642
|
-
labelBand:
|
|
1648
|
+
labelBand: _arg_types.String | None = None,
|
|
1643
1649
|
# pylint: enable=invalid-name
|
|
1644
1650
|
) -> Image:
|
|
1645
1651
|
"""Returns an ee.Image with the directional distance transform.
|
|
@@ -1669,9 +1675,9 @@ class Image(element.Element):
|
|
|
1669
1675
|
def displace(
|
|
1670
1676
|
self,
|
|
1671
1677
|
displacement: _arg_types.Any,
|
|
1672
|
-
mode:
|
|
1678
|
+
mode: _arg_types.String | None = None,
|
|
1673
1679
|
# pylint: disable-next=invalid-name
|
|
1674
|
-
maxOffset:
|
|
1680
|
+
maxOffset: _arg_types.Number | None = None,
|
|
1675
1681
|
) -> Image:
|
|
1676
1682
|
"""Warps an image using an image of displacements.
|
|
1677
1683
|
|
|
@@ -1700,10 +1706,10 @@ class Image(element.Element):
|
|
|
1700
1706
|
# pylint: disable=invalid-name
|
|
1701
1707
|
referenceImage: _arg_types.Image,
|
|
1702
1708
|
maxOffset: _arg_types.Number,
|
|
1703
|
-
projection:
|
|
1704
|
-
patchWidth:
|
|
1709
|
+
projection: _arg_types.Projection | None = None,
|
|
1710
|
+
patchWidth: _arg_types.Number | None = None,
|
|
1705
1711
|
# pylint: enable=invalid-name
|
|
1706
|
-
stiffness:
|
|
1712
|
+
stiffness: _arg_types.Number | None = None,
|
|
1707
1713
|
) -> Image:
|
|
1708
1714
|
"""Returns an ee.Image with the displacement map.
|
|
1709
1715
|
|
|
@@ -1747,9 +1753,9 @@ class Image(element.Element):
|
|
|
1747
1753
|
|
|
1748
1754
|
def distance(
|
|
1749
1755
|
self,
|
|
1750
|
-
kernel:
|
|
1756
|
+
kernel: _arg_types.Kernel | None = None,
|
|
1751
1757
|
# pylint: disable-next=invalid-name
|
|
1752
|
-
skipMasked:
|
|
1758
|
+
skipMasked: _arg_types.Bool | None = True,
|
|
1753
1759
|
) -> Image:
|
|
1754
1760
|
"""Returns an ee.Image with the distance map.
|
|
1755
1761
|
|
|
@@ -1849,9 +1855,9 @@ class Image(element.Element):
|
|
|
1849
1855
|
|
|
1850
1856
|
def fastDistanceTransform(
|
|
1851
1857
|
self,
|
|
1852
|
-
neighborhood:
|
|
1853
|
-
units:
|
|
1854
|
-
metric:
|
|
1858
|
+
neighborhood: _arg_types.Integer | None = None,
|
|
1859
|
+
units: _arg_types.String | None = None,
|
|
1860
|
+
metric: _arg_types.String | None = None,
|
|
1855
1861
|
) -> Image:
|
|
1856
1862
|
"""Returns the distance to the nearest non-zero valued pixel.
|
|
1857
1863
|
|
|
@@ -1928,12 +1934,12 @@ class Image(element.Element):
|
|
|
1928
1934
|
|
|
1929
1935
|
def focalMax(
|
|
1930
1936
|
self,
|
|
1931
|
-
radius:
|
|
1937
|
+
radius: _arg_types.Number | None = None,
|
|
1932
1938
|
# pylint: disable-next=invalid-name
|
|
1933
|
-
kernelType:
|
|
1934
|
-
units:
|
|
1935
|
-
iterations:
|
|
1936
|
-
kernel:
|
|
1939
|
+
kernelType: _arg_types.String | None = None,
|
|
1940
|
+
units: _arg_types.String | None = None,
|
|
1941
|
+
iterations: _arg_types.Integer | None = None,
|
|
1942
|
+
kernel: _arg_types.Kernel | None = None,
|
|
1937
1943
|
) -> Image:
|
|
1938
1944
|
"""Returns the maximum value of the input within the kernel.
|
|
1939
1945
|
|
|
@@ -1962,12 +1968,12 @@ class Image(element.Element):
|
|
|
1962
1968
|
|
|
1963
1969
|
def focalMean(
|
|
1964
1970
|
self,
|
|
1965
|
-
radius:
|
|
1971
|
+
radius: _arg_types.Number | None = None,
|
|
1966
1972
|
# pylint: disable-next=invalid-name
|
|
1967
|
-
kernelType:
|
|
1968
|
-
units:
|
|
1969
|
-
iterations:
|
|
1970
|
-
kernel:
|
|
1973
|
+
kernelType: _arg_types.String | None = None,
|
|
1974
|
+
units: _arg_types.String | None = None,
|
|
1975
|
+
iterations: _arg_types.Integer | None = None,
|
|
1976
|
+
kernel: _arg_types.Kernel | None = None,
|
|
1971
1977
|
) -> Image:
|
|
1972
1978
|
"""Returns the mean value of the input within the kernel.
|
|
1973
1979
|
|
|
@@ -1996,12 +2002,12 @@ class Image(element.Element):
|
|
|
1996
2002
|
|
|
1997
2003
|
def focalMedian(
|
|
1998
2004
|
self,
|
|
1999
|
-
radius:
|
|
2005
|
+
radius: _arg_types.Number | None = None,
|
|
2000
2006
|
# pylint: disable-next=invalid-name
|
|
2001
|
-
kernelType:
|
|
2002
|
-
units:
|
|
2003
|
-
iterations:
|
|
2004
|
-
kernel:
|
|
2007
|
+
kernelType: _arg_types.String | None = None,
|
|
2008
|
+
units: _arg_types.String | None = None,
|
|
2009
|
+
iterations: _arg_types.Integer | None = None,
|
|
2010
|
+
kernel: _arg_types.Kernel | None = None,
|
|
2005
2011
|
) -> Image:
|
|
2006
2012
|
"""Returns the median value of the input within the kernel.
|
|
2007
2013
|
|
|
@@ -2030,12 +2036,12 @@ class Image(element.Element):
|
|
|
2030
2036
|
|
|
2031
2037
|
def focalMin(
|
|
2032
2038
|
self,
|
|
2033
|
-
radius:
|
|
2039
|
+
radius: _arg_types.Number | None = None,
|
|
2034
2040
|
# pylint: disable-next=invalid-name
|
|
2035
|
-
kernelType:
|
|
2036
|
-
units:
|
|
2037
|
-
iterations:
|
|
2038
|
-
kernel:
|
|
2041
|
+
kernelType: _arg_types.String | None = None,
|
|
2042
|
+
units: _arg_types.String | None = None,
|
|
2043
|
+
iterations: _arg_types.Integer | None = None,
|
|
2044
|
+
kernel: _arg_types.Kernel | None = None,
|
|
2039
2045
|
) -> Image:
|
|
2040
2046
|
"""Returns the minimum value of the input within the kernel.
|
|
2041
2047
|
|
|
@@ -2064,12 +2070,12 @@ class Image(element.Element):
|
|
|
2064
2070
|
|
|
2065
2071
|
def focalMode(
|
|
2066
2072
|
self,
|
|
2067
|
-
radius:
|
|
2073
|
+
radius: _arg_types.Number | None = None,
|
|
2068
2074
|
# pylint: disable-next=invalid-name
|
|
2069
|
-
kernelType:
|
|
2070
|
-
units:
|
|
2071
|
-
iterations:
|
|
2072
|
-
kernel:
|
|
2075
|
+
kernelType: _arg_types.String | None = None,
|
|
2076
|
+
units: _arg_types.String | None = None,
|
|
2077
|
+
iterations: _arg_types.Integer | None = None,
|
|
2078
|
+
kernel: _arg_types.Kernel | None = None,
|
|
2073
2079
|
) -> Image:
|
|
2074
2080
|
"""Returns the mode value of the input within the kernel.
|
|
2075
2081
|
|
|
@@ -2124,9 +2130,9 @@ class Image(element.Element):
|
|
|
2124
2130
|
def geometry(
|
|
2125
2131
|
self,
|
|
2126
2132
|
# pylint: disable-next=invalid-name
|
|
2127
|
-
maxError:
|
|
2128
|
-
proj:
|
|
2129
|
-
geodesics:
|
|
2133
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
2134
|
+
proj: _arg_types.Projection | None = None,
|
|
2135
|
+
geodesics: _arg_types.Bool | None = None,
|
|
2130
2136
|
) -> ee_geometry.Geometry:
|
|
2131
2137
|
"""Returns the geometry of a given feature in a given projection.
|
|
2132
2138
|
|
|
@@ -2147,9 +2153,9 @@ class Image(element.Element):
|
|
|
2147
2153
|
|
|
2148
2154
|
def glcmTexture(
|
|
2149
2155
|
self,
|
|
2150
|
-
size:
|
|
2151
|
-
kernel:
|
|
2152
|
-
average:
|
|
2156
|
+
size: _arg_types.Integer | None = None,
|
|
2157
|
+
kernel: _arg_types.Kernel | None = None,
|
|
2158
|
+
average: _arg_types.Bool | None = None,
|
|
2153
2159
|
) -> Image:
|
|
2154
2160
|
"""Returns the GLCM texture metrics.
|
|
2155
2161
|
|
|
@@ -2252,10 +2258,10 @@ class Image(element.Element):
|
|
|
2252
2258
|
|
|
2253
2259
|
def hersDescriptor(
|
|
2254
2260
|
self,
|
|
2255
|
-
selectors:
|
|
2256
|
-
buckets:
|
|
2261
|
+
selectors: _arg_types.List | None = None,
|
|
2262
|
+
buckets: _arg_types.Integer | None = None,
|
|
2257
2263
|
# pylint: disable-next=invalid-name
|
|
2258
|
-
peakWidthScale:
|
|
2264
|
+
peakWidthScale: _arg_types.Number | None = None,
|
|
2259
2265
|
) -> dictionary.Dictionary:
|
|
2260
2266
|
"""Returns a dictionary of Histogram Error Ring Statistic (HERS) arrays.
|
|
2261
2267
|
|
|
@@ -2284,7 +2290,7 @@ class Image(element.Element):
|
|
|
2284
2290
|
self,
|
|
2285
2291
|
reference: _arg_types.Dictionary,
|
|
2286
2292
|
# pylint: disable-next=invalid-name
|
|
2287
|
-
peakWidthScale:
|
|
2293
|
+
peakWidthScale: _arg_types.Number | None = None,
|
|
2288
2294
|
) -> Image:
|
|
2289
2295
|
"""Returns an ee.Image with Histogram Error Ring Statistic (HERS).
|
|
2290
2296
|
|
|
@@ -2306,9 +2312,9 @@ class Image(element.Element):
|
|
|
2306
2312
|
self,
|
|
2307
2313
|
image2: _arg_types.Image,
|
|
2308
2314
|
radius: _arg_types.Integer,
|
|
2309
|
-
buckets:
|
|
2315
|
+
buckets: _arg_types.Integer | None = None,
|
|
2310
2316
|
# pylint: disable-next=invalid-name
|
|
2311
|
-
peakWidthScale:
|
|
2317
|
+
peakWidthScale: _arg_types.Number | None = None,
|
|
2312
2318
|
) -> Image:
|
|
2313
2319
|
"""Returns an Image with Histogram Error Ring Statistic (HERS) for pairs.
|
|
2314
2320
|
|
|
@@ -2399,7 +2405,7 @@ class Image(element.Element):
|
|
|
2399
2405
|
self,
|
|
2400
2406
|
x: _arg_types.List,
|
|
2401
2407
|
y: _arg_types.List,
|
|
2402
|
-
behavior:
|
|
2408
|
+
behavior: _arg_types.String | None = None,
|
|
2403
2409
|
) -> Image:
|
|
2404
2410
|
"""Returns an ee.Image with interpolated values.
|
|
2405
2411
|
|
|
@@ -2453,9 +2459,9 @@ class Image(element.Element):
|
|
|
2453
2459
|
self,
|
|
2454
2460
|
# pylint: disable=invalid-name
|
|
2455
2461
|
imageCollection: _arg_types.ImageCollection,
|
|
2456
|
-
linkedBands:
|
|
2457
|
-
linkedProperties:
|
|
2458
|
-
matchPropertyName:
|
|
2462
|
+
linkedBands: _arg_types.Any | None = None,
|
|
2463
|
+
linkedProperties: _arg_types.Any | None = None,
|
|
2464
|
+
matchPropertyName: _arg_types.String | None = None,
|
|
2459
2465
|
# pylint: enable=invalid-name
|
|
2460
2466
|
) -> Image:
|
|
2461
2467
|
"""Links the source image to a matching image from an image collection.
|
|
@@ -2504,7 +2510,7 @@ class Image(element.Element):
|
|
|
2504
2510
|
@staticmethod
|
|
2505
2511
|
def load(
|
|
2506
2512
|
id: _arg_types.String, # pylint: disable=redefined-builtin
|
|
2507
|
-
version:
|
|
2513
|
+
version: _arg_types.Integer | None = None,
|
|
2508
2514
|
) -> Image:
|
|
2509
2515
|
"""Returns the image given its ID.
|
|
2510
2516
|
|
|
@@ -2585,7 +2591,7 @@ class Image(element.Element):
|
|
|
2585
2591
|
|
|
2586
2592
|
return apifunction.ApiFunction.call_(self.name() + '.lte', self, image2)
|
|
2587
2593
|
|
|
2588
|
-
def mask(self, mask:
|
|
2594
|
+
def mask(self, mask: _arg_types.Image | None = None) -> Image:
|
|
2589
2595
|
"""Gets or sets an image's mask.
|
|
2590
2596
|
|
|
2591
2597
|
The output image retains the metadata and footprint of the input image.
|
|
@@ -2765,8 +2771,8 @@ class Image(element.Element):
|
|
|
2765
2771
|
|
|
2766
2772
|
def matrixTranspose(
|
|
2767
2773
|
self,
|
|
2768
|
-
axis1:
|
|
2769
|
-
axis2:
|
|
2774
|
+
axis1: _arg_types.Integer | None = None,
|
|
2775
|
+
axis2: _arg_types.Integer | None = None,
|
|
2770
2776
|
) -> Image:
|
|
2771
2777
|
"""Transposes two dimensions of each array pixel.
|
|
2772
2778
|
|
|
@@ -2804,8 +2810,8 @@ class Image(element.Element):
|
|
|
2804
2810
|
|
|
2805
2811
|
def medialAxis(
|
|
2806
2812
|
self,
|
|
2807
|
-
neighborhood:
|
|
2808
|
-
units:
|
|
2813
|
+
neighborhood: _arg_types.Integer | None = None,
|
|
2814
|
+
units: _arg_types.String | None = None,
|
|
2809
2815
|
) -> Image:
|
|
2810
2816
|
"""Returns the discrete medial axis of the input image.
|
|
2811
2817
|
|
|
@@ -2833,7 +2839,7 @@ class Image(element.Element):
|
|
|
2833
2839
|
def metadata(
|
|
2834
2840
|
self,
|
|
2835
2841
|
property: _arg_types.String, # pylint: disable=redefined-builtin
|
|
2836
|
-
name:
|
|
2842
|
+
name: _arg_types.String | None = None,
|
|
2837
2843
|
) -> Image:
|
|
2838
2844
|
"""Generates a constant image of type double from a metadata property.
|
|
2839
2845
|
|
|
@@ -2907,7 +2913,7 @@ class Image(element.Element):
|
|
|
2907
2913
|
self,
|
|
2908
2914
|
kernel: _arg_types.Kernel,
|
|
2909
2915
|
# pylint: disable-next=invalid-name
|
|
2910
|
-
defaultValue:
|
|
2916
|
+
defaultValue: _arg_types.Number | None = None,
|
|
2911
2917
|
) -> Image:
|
|
2912
2918
|
"""Turns the neighborhood of each pixel in a scalar image into a 2D array.
|
|
2913
2919
|
|
|
@@ -2975,7 +2981,7 @@ class Image(element.Element):
|
|
|
2975
2981
|
def normalizedDifference(
|
|
2976
2982
|
self,
|
|
2977
2983
|
# pylint: disable-next=invalid-name
|
|
2978
|
-
bandNames:
|
|
2984
|
+
bandNames: _arg_types.Any | None = None,
|
|
2979
2985
|
) -> Image:
|
|
2980
2986
|
"""Computes the normalized difference between two bands.
|
|
2981
2987
|
|
|
@@ -3026,8 +3032,8 @@ class Image(element.Element):
|
|
|
3026
3032
|
self,
|
|
3027
3033
|
# pylint: disable-next=invalid-name
|
|
3028
3034
|
featureCollection: _arg_types.FeatureCollection,
|
|
3029
|
-
color:
|
|
3030
|
-
width:
|
|
3035
|
+
color: _arg_types.Any | None = None,
|
|
3036
|
+
width: _arg_types.Any | None = None,
|
|
3031
3037
|
) -> Image:
|
|
3032
3038
|
"""Returns an image with the geometries of a collection painted onto it.
|
|
3033
3039
|
|
|
@@ -3133,8 +3139,8 @@ class Image(element.Element):
|
|
|
3133
3139
|
|
|
3134
3140
|
@staticmethod
|
|
3135
3141
|
def random(
|
|
3136
|
-
seed:
|
|
3137
|
-
distribution:
|
|
3142
|
+
seed: _arg_types.Integer | None = None,
|
|
3143
|
+
distribution: _arg_types.String | None = None,
|
|
3138
3144
|
) -> Image:
|
|
3139
3145
|
"""Returns an image with a random number at each pixel location.
|
|
3140
3146
|
|
|
@@ -3187,8 +3193,8 @@ class Image(element.Element):
|
|
|
3187
3193
|
self,
|
|
3188
3194
|
reducer: _arg_types.Reducer,
|
|
3189
3195
|
# pylint: disable=invalid-name
|
|
3190
|
-
labelBand:
|
|
3191
|
-
maxSize:
|
|
3196
|
+
labelBand: _arg_types.String | None = None,
|
|
3197
|
+
maxSize: _arg_types.Integer | None = None,
|
|
3192
3198
|
# pylint: enable=invalid-name
|
|
3193
3199
|
) -> Image:
|
|
3194
3200
|
"""Applies a reducer to all of the pixels inside of each 'object'.
|
|
@@ -3223,10 +3229,10 @@ class Image(element.Element):
|
|
|
3223
3229
|
reducer: _arg_types.Reducer,
|
|
3224
3230
|
kernel: _arg_types.Kernel,
|
|
3225
3231
|
# pylint: disable=invalid-name
|
|
3226
|
-
inputWeight:
|
|
3227
|
-
skipMasked:
|
|
3232
|
+
inputWeight: _arg_types.String | None = None,
|
|
3233
|
+
skipMasked: _arg_types.Bool | None = None,
|
|
3228
3234
|
# pylint: enable=invalid-name
|
|
3229
|
-
optimization:
|
|
3235
|
+
optimization: _arg_types.String | None = None,
|
|
3230
3236
|
) -> Image:
|
|
3231
3237
|
"""Returns an ee.Image with the reducer applied as determined by the kernel.
|
|
3232
3238
|
|
|
@@ -3268,14 +3274,14 @@ class Image(element.Element):
|
|
|
3268
3274
|
def reduceRegion(
|
|
3269
3275
|
self,
|
|
3270
3276
|
reducer: _arg_types.Reducer,
|
|
3271
|
-
geometry:
|
|
3272
|
-
scale:
|
|
3273
|
-
crs:
|
|
3277
|
+
geometry: _arg_types.Geometry | None = None,
|
|
3278
|
+
scale: _arg_types.Number | None = None,
|
|
3279
|
+
crs: _arg_types.Projection | None = None,
|
|
3274
3280
|
# pylint: disable=invalid-name
|
|
3275
|
-
crsTransform:
|
|
3276
|
-
bestEffort:
|
|
3277
|
-
maxPixels:
|
|
3278
|
-
tileScale:
|
|
3281
|
+
crsTransform: _arg_types.List | None = None,
|
|
3282
|
+
bestEffort: _arg_types.Bool | None = None,
|
|
3283
|
+
maxPixels: _arg_types.Integer | None = None,
|
|
3284
|
+
tileScale: _arg_types.Number | None = None,
|
|
3279
3285
|
# pylint: enable=invalid-name
|
|
3280
3286
|
) -> dictionary.Dictionary:
|
|
3281
3287
|
"""Apply a reducer to all the pixels in a specific region.
|
|
@@ -3324,12 +3330,12 @@ class Image(element.Element):
|
|
|
3324
3330
|
self,
|
|
3325
3331
|
collection: _arg_types.FeatureCollection,
|
|
3326
3332
|
reducer: _arg_types.Reducer,
|
|
3327
|
-
scale:
|
|
3328
|
-
crs:
|
|
3333
|
+
scale: _arg_types.Number | None = None,
|
|
3334
|
+
crs: _arg_types.Projection | None = None,
|
|
3329
3335
|
# pylint: disable=invalid-name
|
|
3330
|
-
crsTransform:
|
|
3331
|
-
tileScale:
|
|
3332
|
-
maxPixelsPerRegion:
|
|
3336
|
+
crsTransform: _arg_types.List | None = None,
|
|
3337
|
+
tileScale: _arg_types.Number | None = None,
|
|
3338
|
+
maxPixelsPerRegion: _arg_types.Integer | None = None,
|
|
3333
3339
|
# pylint: enable=invalid-name
|
|
3334
3340
|
) -> featurecollection.FeatureCollection:
|
|
3335
3341
|
"""Apply a reducer over the area of each feature in the given collection.
|
|
@@ -3374,8 +3380,8 @@ class Image(element.Element):
|
|
|
3374
3380
|
self,
|
|
3375
3381
|
reducer: _arg_types.Reducer,
|
|
3376
3382
|
# pylint: disable=invalid-name
|
|
3377
|
-
bestEffort:
|
|
3378
|
-
maxPixels:
|
|
3383
|
+
bestEffort: _arg_types.Bool | None = None,
|
|
3384
|
+
maxPixels: _arg_types.Integer | None = None,
|
|
3379
3385
|
# pylint: enable=invalid-name
|
|
3380
3386
|
) -> Image:
|
|
3381
3387
|
"""Returns an ee.Image with the reducer applied to combine all input pixels.
|
|
@@ -3410,21 +3416,21 @@ class Image(element.Element):
|
|
|
3410
3416
|
|
|
3411
3417
|
def reduceToVectors(
|
|
3412
3418
|
self,
|
|
3413
|
-
reducer:
|
|
3414
|
-
geometry:
|
|
3415
|
-
scale:
|
|
3419
|
+
reducer: _arg_types.Reducer | None = None,
|
|
3420
|
+
geometry: _arg_types.Geometry | None = None,
|
|
3421
|
+
scale: _arg_types.Number | None = None,
|
|
3416
3422
|
# pylint: disable=invalid-name
|
|
3417
|
-
geometryType:
|
|
3418
|
-
eightConnected:
|
|
3419
|
-
labelProperty:
|
|
3423
|
+
geometryType: _arg_types.String | None = None,
|
|
3424
|
+
eightConnected: _arg_types.Bool | None = None,
|
|
3425
|
+
labelProperty: _arg_types.String | None = None,
|
|
3420
3426
|
# pylint: enable=invalid-name
|
|
3421
|
-
crs:
|
|
3427
|
+
crs: _arg_types.Projection | None = None,
|
|
3422
3428
|
# pylint: disable=invalid-name
|
|
3423
|
-
crsTransform:
|
|
3424
|
-
bestEffort:
|
|
3425
|
-
maxPixels:
|
|
3426
|
-
tileScale:
|
|
3427
|
-
geometryInNativeProjection:
|
|
3429
|
+
crsTransform: _arg_types.List | None = None,
|
|
3430
|
+
bestEffort: _arg_types.Bool | None = None,
|
|
3431
|
+
maxPixels: _arg_types.Integer | None = None,
|
|
3432
|
+
tileScale: _arg_types.Number | None = None,
|
|
3433
|
+
geometryInNativeProjection: _arg_types.Bool | None = None,
|
|
3428
3434
|
# pylint: enable=invalid-name
|
|
3429
3435
|
) -> featurecollection.FeatureCollection:
|
|
3430
3436
|
"""Convert an image to a feature collection by reducing homogeneous regions.
|
|
@@ -3492,7 +3498,7 @@ class Image(element.Element):
|
|
|
3492
3498
|
regex: _arg_types.String,
|
|
3493
3499
|
replacement: _arg_types.String,
|
|
3494
3500
|
# pylint: disable-next=redefined-builtin
|
|
3495
|
-
all:
|
|
3501
|
+
all: _arg_types.Bool | None = None,
|
|
3496
3502
|
) -> Image:
|
|
3497
3503
|
"""Renames the bands of an image.
|
|
3498
3504
|
|
|
@@ -3520,9 +3526,9 @@ class Image(element.Element):
|
|
|
3520
3526
|
# pylint: disable=invalid-name
|
|
3521
3527
|
referenceImage: _arg_types.Image,
|
|
3522
3528
|
maxOffset: _arg_types.Number,
|
|
3523
|
-
patchWidth:
|
|
3529
|
+
patchWidth: _arg_types.Number | None = None,
|
|
3524
3530
|
# pylint: enable=invalid-name
|
|
3525
|
-
stiffness:
|
|
3531
|
+
stiffness: _arg_types.Number | None = None,
|
|
3526
3532
|
) -> Image:
|
|
3527
3533
|
"""Registers an image to a reference image.
|
|
3528
3534
|
|
|
@@ -3564,15 +3570,14 @@ class Image(element.Element):
|
|
|
3564
3570
|
|
|
3565
3571
|
def remap(
|
|
3566
3572
|
self,
|
|
3567
|
-
from_:
|
|
3568
|
-
to:
|
|
3573
|
+
from_: _arg_types.List | None = None,
|
|
3574
|
+
to: _arg_types.List | None = None,
|
|
3569
3575
|
# pylint: disable=invalid-name
|
|
3570
|
-
defaultValue:
|
|
3571
|
-
bandName:
|
|
3576
|
+
defaultValue: _arg_types.Any | None = None,
|
|
3577
|
+
bandName: _arg_types.String | None = None,
|
|
3572
3578
|
# pylint: enable=invalid-name
|
|
3573
3579
|
**kwargs,
|
|
3574
3580
|
) -> Image:
|
|
3575
|
-
# pylint: disable=g-doc-args
|
|
3576
3581
|
"""Returns an image with the values of a band remapped.
|
|
3577
3582
|
|
|
3578
3583
|
Maps from input values to output values, represented by two parallel lists.
|
|
@@ -3582,24 +3587,21 @@ class Image(element.Element):
|
|
|
3582
3587
|
floating point precision errors.
|
|
3583
3588
|
|
|
3584
3589
|
Args:
|
|
3585
|
-
|
|
3590
|
+
from_: The source values (numbers or ee.Array). All values in this list
|
|
3586
3591
|
will be mapped to the corresponding value in 'to'.
|
|
3587
3592
|
to: The destination values (numbers or ee.Array). These are used to
|
|
3588
3593
|
replace the corresponding values in 'from'. Must have the same number of
|
|
3589
|
-
values as '
|
|
3594
|
+
values as 'from_'.
|
|
3590
3595
|
defaultValue: The default value to replace values that weren't matched by
|
|
3591
|
-
a value in '
|
|
3596
|
+
a value in 'from_'. If not specified, unmatched values are masked out.
|
|
3592
3597
|
bandName: The name of the band to remap. If not specified, the first band
|
|
3593
3598
|
in the image is used.
|
|
3594
3599
|
"""
|
|
3595
|
-
# pylint: enable=g-doc-args
|
|
3596
3600
|
|
|
3601
|
+
if 'from' in kwargs:
|
|
3602
|
+
from_ = kwargs.pop('from')
|
|
3597
3603
|
if kwargs:
|
|
3598
|
-
|
|
3599
|
-
raise TypeError(
|
|
3600
|
-
f'Unexpected arguments: {list(kwargs.keys())}. Expected: from.'
|
|
3601
|
-
)
|
|
3602
|
-
from_ = kwargs['from']
|
|
3604
|
+
raise TypeError(f'remap() got unexpected keyword arguments: {list(kwargs)}')
|
|
3603
3605
|
|
|
3604
3606
|
if not from_:
|
|
3605
3607
|
raise TypeError('from is required.')
|
|
@@ -3636,8 +3638,8 @@ class Image(element.Element):
|
|
|
3636
3638
|
self,
|
|
3637
3639
|
crs: _arg_types.Projection,
|
|
3638
3640
|
# pylint: disable-next=invalid-name
|
|
3639
|
-
crsTransform:
|
|
3640
|
-
scale:
|
|
3641
|
+
crsTransform: _arg_types.List | None = None,
|
|
3642
|
+
scale: _arg_types.Number | None = None,
|
|
3641
3643
|
) -> Image:
|
|
3642
3644
|
"""Force an image to be computed in a given projection and resolution.
|
|
3643
3645
|
|
|
@@ -3660,7 +3662,7 @@ class Image(element.Element):
|
|
|
3660
3662
|
self.name() + '.reproject', self, crs, crsTransform, scale
|
|
3661
3663
|
)
|
|
3662
3664
|
|
|
3663
|
-
def resample(self, mode:
|
|
3665
|
+
def resample(self, mode: _arg_types.String | None = None) -> Image:
|
|
3664
3666
|
"""Returns an image that uses bilinear or bicubic interpolation.
|
|
3665
3667
|
|
|
3666
3668
|
An algorithm that returns an image identical to its argument, but which uses
|
|
@@ -3722,8 +3724,8 @@ class Image(element.Element):
|
|
|
3722
3724
|
|
|
3723
3725
|
def rsedTransform(
|
|
3724
3726
|
self,
|
|
3725
|
-
neighborhood:
|
|
3726
|
-
units:
|
|
3727
|
+
neighborhood: _arg_types.Integer | None = None,
|
|
3728
|
+
units: _arg_types.String | None = None,
|
|
3727
3729
|
) -> Image:
|
|
3728
3730
|
"""Calculated the Reverse Squared Euclidean Distance (RSED).
|
|
3729
3731
|
|
|
@@ -3748,16 +3750,16 @@ class Image(element.Element):
|
|
|
3748
3750
|
|
|
3749
3751
|
def sample(
|
|
3750
3752
|
self,
|
|
3751
|
-
region:
|
|
3752
|
-
scale:
|
|
3753
|
-
projection:
|
|
3754
|
-
factor:
|
|
3753
|
+
region: _arg_types.Geometry | None = None,
|
|
3754
|
+
scale: _arg_types.Number | None = None,
|
|
3755
|
+
projection: _arg_types.Projection | None = None,
|
|
3756
|
+
factor: _arg_types.Number | None = None,
|
|
3755
3757
|
# pylint: disable=invalid-name
|
|
3756
|
-
numPixels:
|
|
3757
|
-
seed:
|
|
3758
|
-
dropNulls:
|
|
3759
|
-
tileScale:
|
|
3760
|
-
geometries:
|
|
3758
|
+
numPixels: _arg_types.Integer | None = None,
|
|
3759
|
+
seed: _arg_types.Integer | None = None,
|
|
3760
|
+
dropNulls: _arg_types.Bool | None = None,
|
|
3761
|
+
tileScale: _arg_types.Number | None = None,
|
|
3762
|
+
geometries: _arg_types.Bool | None = None,
|
|
3761
3763
|
# pylint: enable=invalid-name
|
|
3762
3764
|
) -> featurecollection.FeatureCollection:
|
|
3763
3765
|
"""Returns an ee.FeatureCollection of samples from an ee.Image.
|
|
@@ -3805,11 +3807,11 @@ class Image(element.Element):
|
|
|
3805
3807
|
|
|
3806
3808
|
def sampleRectangle(
|
|
3807
3809
|
self,
|
|
3808
|
-
region:
|
|
3809
|
-
properties:
|
|
3810
|
+
region: _arg_types.Any | None = None,
|
|
3811
|
+
properties: _arg_types.List | None = None,
|
|
3810
3812
|
# pylint: disable=invalid-name
|
|
3811
|
-
defaultValue:
|
|
3812
|
-
defaultArrayValue:
|
|
3813
|
+
defaultValue: _arg_types.Number | None = None,
|
|
3814
|
+
defaultArrayValue: _arg_types.Array | None = None,
|
|
3813
3815
|
# pylint: enable=invalid-name
|
|
3814
3816
|
) -> feature.Feature:
|
|
3815
3817
|
"""Returns pixels from an image into a ND array per band.
|
|
@@ -3847,12 +3849,12 @@ class Image(element.Element):
|
|
|
3847
3849
|
def sampleRegions(
|
|
3848
3850
|
self,
|
|
3849
3851
|
collection: _arg_types.FeatureCollection,
|
|
3850
|
-
properties:
|
|
3851
|
-
scale:
|
|
3852
|
-
projection:
|
|
3852
|
+
properties: _arg_types.List | None = None,
|
|
3853
|
+
scale: _arg_types.Number | None = None,
|
|
3854
|
+
projection: _arg_types.Projection | None = None,
|
|
3853
3855
|
# pylint: disable-next=invalid-name
|
|
3854
|
-
tileScale:
|
|
3855
|
-
geometries:
|
|
3856
|
+
tileScale: _arg_types.Number | None = None,
|
|
3857
|
+
geometries: _arg_types.Bool | None = None,
|
|
3856
3858
|
) -> featurecollection.FeatureCollection:
|
|
3857
3859
|
"""Returns an ee.FeatureCollection of samples from an ee.Image.
|
|
3858
3860
|
|
|
@@ -3895,8 +3897,8 @@ class Image(element.Element):
|
|
|
3895
3897
|
# pylint: disable-next=keyword-arg-before-vararg
|
|
3896
3898
|
def select(
|
|
3897
3899
|
self,
|
|
3898
|
-
selectors:
|
|
3899
|
-
names:
|
|
3900
|
+
selectors: _arg_types.List | None = None,
|
|
3901
|
+
names: _arg_types.List | None = None,
|
|
3900
3902
|
*args,
|
|
3901
3903
|
) -> Image:
|
|
3902
3904
|
"""Selects bands from an image.
|
|
@@ -3973,8 +3975,8 @@ class Image(element.Element):
|
|
|
3973
3975
|
self,
|
|
3974
3976
|
crs: _arg_types.Projection,
|
|
3975
3977
|
# pylint: disable-next=invalid-name
|
|
3976
|
-
crsTransform:
|
|
3977
|
-
scale:
|
|
3978
|
+
crsTransform: _arg_types.List | None = None,
|
|
3979
|
+
scale: _arg_types.Number | None = None,
|
|
3978
3980
|
) -> Image:
|
|
3979
3981
|
"""Set a default projection to be applied to this image.
|
|
3980
3982
|
|
|
@@ -4063,7 +4065,7 @@ class Image(element.Element):
|
|
|
4063
4065
|
)
|
|
4064
4066
|
|
|
4065
4067
|
def slice(
|
|
4066
|
-
self, start: _arg_types.Integer, end:
|
|
4068
|
+
self, start: _arg_types.Integer, end: _arg_types.Integer | None = None
|
|
4067
4069
|
) -> Image:
|
|
4068
4070
|
"""Selects a contiguous group of bands from an image by position.
|
|
4069
4071
|
|
|
@@ -4083,10 +4085,10 @@ class Image(element.Element):
|
|
|
4083
4085
|
|
|
4084
4086
|
def spectralDilation(
|
|
4085
4087
|
self,
|
|
4086
|
-
metric:
|
|
4087
|
-
kernel:
|
|
4088
|
+
metric: _arg_types.String | None = None,
|
|
4089
|
+
kernel: _arg_types.Kernel | None = None,
|
|
4088
4090
|
# pylint: disable-next=invalid-name
|
|
4089
|
-
useCentroid:
|
|
4091
|
+
useCentroid: _arg_types.Bool | None = None,
|
|
4090
4092
|
) -> Image:
|
|
4091
4093
|
"""Returns the spectral/spatial dilation of an image.
|
|
4092
4094
|
|
|
@@ -4113,7 +4115,7 @@ class Image(element.Element):
|
|
|
4113
4115
|
)
|
|
4114
4116
|
|
|
4115
4117
|
def spectralDistance(
|
|
4116
|
-
self, image2: _arg_types.Image, metric:
|
|
4118
|
+
self, image2: _arg_types.Image, metric: _arg_types.String | None = None
|
|
4117
4119
|
) -> Image:
|
|
4118
4120
|
"""Computes the per-pixel spectral distance between two images.
|
|
4119
4121
|
|
|
@@ -4138,10 +4140,10 @@ class Image(element.Element):
|
|
|
4138
4140
|
|
|
4139
4141
|
def spectralErosion(
|
|
4140
4142
|
self,
|
|
4141
|
-
metric:
|
|
4142
|
-
kernel:
|
|
4143
|
+
metric: _arg_types.String | None = None,
|
|
4144
|
+
kernel: _arg_types.Kernel | None = None,
|
|
4143
4145
|
# pylint: disable-next=invalid-name
|
|
4144
|
-
useCentroid:
|
|
4146
|
+
useCentroid: _arg_types.Bool | None = None,
|
|
4145
4147
|
) -> Image:
|
|
4146
4148
|
"""Returns the spectral/spatial erosion of an image.
|
|
4147
4149
|
|
|
@@ -4169,10 +4171,10 @@ class Image(element.Element):
|
|
|
4169
4171
|
|
|
4170
4172
|
def spectralGradient(
|
|
4171
4173
|
self,
|
|
4172
|
-
metric:
|
|
4173
|
-
kernel:
|
|
4174
|
+
metric: _arg_types.String | None = None,
|
|
4175
|
+
kernel: _arg_types.Kernel | None = None,
|
|
4174
4176
|
# pylint: disable-next=invalid-name
|
|
4175
|
-
useCentroid:
|
|
4177
|
+
useCentroid: _arg_types.Bool | None = None,
|
|
4176
4178
|
) -> Image:
|
|
4177
4179
|
"""Returns the spectral gradient of an image.
|
|
4178
4180
|
|
|
@@ -4206,19 +4208,19 @@ class Image(element.Element):
|
|
|
4206
4208
|
self,
|
|
4207
4209
|
# pylint: disable=invalid-name
|
|
4208
4210
|
numPoints: _arg_types.Integer,
|
|
4209
|
-
classBand:
|
|
4211
|
+
classBand: _arg_types.String | None = None,
|
|
4210
4212
|
# pylint: enable=invalid-name
|
|
4211
|
-
region:
|
|
4212
|
-
scale:
|
|
4213
|
-
projection:
|
|
4214
|
-
seed:
|
|
4213
|
+
region: _arg_types.Geometry | None = None,
|
|
4214
|
+
scale: _arg_types.Number | None = None,
|
|
4215
|
+
projection: _arg_types.Projection | None = None,
|
|
4216
|
+
seed: _arg_types.Integer | None = None,
|
|
4215
4217
|
# pylint: disable=invalid-name
|
|
4216
|
-
classValues:
|
|
4217
|
-
classPoints:
|
|
4218
|
-
dropNulls:
|
|
4219
|
-
tileScale:
|
|
4218
|
+
classValues: _arg_types.List | None = None,
|
|
4219
|
+
classPoints: _arg_types.List | None = None,
|
|
4220
|
+
dropNulls: _arg_types.Bool | None = None,
|
|
4221
|
+
tileScale: _arg_types.Number | None = None,
|
|
4220
4222
|
# pylint: enable=invalid-name
|
|
4221
|
-
geometries:
|
|
4223
|
+
geometries: _arg_types.Bool | None = None,
|
|
4222
4224
|
) -> featurecollection.FeatureCollection:
|
|
4223
4225
|
"""Extracts a stratified random sample of points from an image.
|
|
4224
4226
|
|
|
@@ -4305,7 +4307,7 @@ class Image(element.Element):
|
|
|
4305
4307
|
|
|
4306
4308
|
return apifunction.ApiFunction.call_(self.name() + '.tanh', self)
|
|
4307
4309
|
|
|
4308
|
-
def toArray(self, axis:
|
|
4310
|
+
def toArray(self, axis: _arg_types.Integer | None = None) -> Image:
|
|
4309
4311
|
"""Concatenates pixels from each band into a single array per pixel.
|
|
4310
4312
|
|
|
4311
4313
|
The result will be masked if any input bands are masked.
|
|
@@ -4390,8 +4392,8 @@ class Image(element.Element):
|
|
|
4390
4392
|
self,
|
|
4391
4393
|
x: _arg_types.Number,
|
|
4392
4394
|
y: _arg_types.Number,
|
|
4393
|
-
units:
|
|
4394
|
-
proj:
|
|
4395
|
+
units: _arg_types.String | None = None,
|
|
4396
|
+
proj: _arg_types.Projection | None = None,
|
|
4395
4397
|
) -> Image:
|
|
4396
4398
|
"""Translate the input image.
|
|
4397
4399
|
|
|
@@ -4451,9 +4453,9 @@ class Image(element.Element):
|
|
|
4451
4453
|
|
|
4452
4454
|
def unmask(
|
|
4453
4455
|
self,
|
|
4454
|
-
value:
|
|
4456
|
+
value: _arg_types.Image | None = None,
|
|
4455
4457
|
# pylint: disable-next=invalid-name
|
|
4456
|
-
sameFootprint:
|
|
4458
|
+
sameFootprint: _arg_types.Bool | None = None,
|
|
4457
4459
|
) -> Image:
|
|
4458
4460
|
"""Returns an ee.Image with mask and value of the value image.
|
|
4459
4461
|
|
|
@@ -4482,8 +4484,8 @@ class Image(element.Element):
|
|
|
4482
4484
|
self,
|
|
4483
4485
|
endmembers: _arg_types.List,
|
|
4484
4486
|
# pylint: disable=invalid-name
|
|
4485
|
-
sumToOne:
|
|
4486
|
-
nonNegative:
|
|
4487
|
+
sumToOne: _arg_types.Bool | None = None,
|
|
4488
|
+
nonNegative: _arg_types.Bool | None = None,
|
|
4487
4489
|
# pylint: enable=invalid-name
|
|
4488
4490
|
) -> Image:
|
|
4489
4491
|
"""Returns an ee.Image with endmembers unmixing each pixel.
|
|
@@ -4528,16 +4530,16 @@ class Image(element.Element):
|
|
|
4528
4530
|
|
|
4529
4531
|
def visualize(
|
|
4530
4532
|
self,
|
|
4531
|
-
bands:
|
|
4532
|
-
gain:
|
|
4533
|
-
bias:
|
|
4534
|
-
min:
|
|
4535
|
-
max:
|
|
4536
|
-
gamma:
|
|
4537
|
-
opacity:
|
|
4538
|
-
palette:
|
|
4533
|
+
bands: _arg_types.Any | None = None,
|
|
4534
|
+
gain: _arg_types.Any | None = None,
|
|
4535
|
+
bias: _arg_types.Any | None = None,
|
|
4536
|
+
min: _arg_types.Any | None = None, # pylint: disable=redefined-builtin
|
|
4537
|
+
max: _arg_types.Any | None = None, # pylint: disable=redefined-builtin
|
|
4538
|
+
gamma: _arg_types.Any | None = None,
|
|
4539
|
+
opacity: _arg_types.Number | None = None,
|
|
4540
|
+
palette: _arg_types.Any | None = None,
|
|
4539
4541
|
# pylint: disable-next=invalid-name
|
|
4540
|
-
forceRgbOutput:
|
|
4542
|
+
forceRgbOutput: _arg_types.Bool | None = None,
|
|
4541
4543
|
) -> Image:
|
|
4542
4544
|
"""Produces an RGB or grayscale visualization of an image.
|
|
4543
4545
|
|