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/feature.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""An object representing EE Features."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Any
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
6
|
from ee import _arg_types
|
|
7
7
|
from ee import _utils
|
|
@@ -10,7 +10,6 @@ from ee import computedobject
|
|
|
10
10
|
from ee import dictionary
|
|
11
11
|
from ee import ee_array
|
|
12
12
|
from ee import ee_exception
|
|
13
|
-
from ee import ee_list
|
|
14
13
|
from ee import ee_number
|
|
15
14
|
from ee import ee_string
|
|
16
15
|
from ee import element
|
|
@@ -28,17 +27,15 @@ class Feature(element.Element):
|
|
|
28
27
|
@_utils.accept_opt_prefix('opt_properties')
|
|
29
28
|
def __init__(
|
|
30
29
|
self,
|
|
31
|
-
geom:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
Union[Dict[str, Any], computedobject.ComputedObject]
|
|
41
|
-
] = None,
|
|
30
|
+
geom: None | (
|
|
31
|
+
Feature |
|
|
32
|
+
geometry.Geometry |
|
|
33
|
+
dict[str, Any] |
|
|
34
|
+
computedobject.ComputedObject
|
|
35
|
+
),
|
|
36
|
+
properties: None | (
|
|
37
|
+
dict[str, Any] | computedobject.ComputedObject
|
|
38
|
+
) = None,
|
|
42
39
|
):
|
|
43
40
|
"""Creates a feature a geometry or computed object.
|
|
44
41
|
|
|
@@ -113,8 +110,8 @@ class Feature(element.Element):
|
|
|
113
110
|
cls._initialized = False
|
|
114
111
|
|
|
115
112
|
def getMapId(
|
|
116
|
-
self, vis_params:
|
|
117
|
-
) ->
|
|
113
|
+
self, vis_params: dict[str, Any] | None = None
|
|
114
|
+
) -> dict[str, Any]:
|
|
118
115
|
"""Fetch and return a map id and token, suitable for use in a Map overlay.
|
|
119
116
|
|
|
120
117
|
Args:
|
|
@@ -137,8 +134,8 @@ class Feature(element.Element):
|
|
|
137
134
|
def area(
|
|
138
135
|
self,
|
|
139
136
|
# pylint: disable-next=invalid-name
|
|
140
|
-
maxError:
|
|
141
|
-
proj:
|
|
137
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
138
|
+
proj: _arg_types.Projection | None = None,
|
|
142
139
|
) -> ee_number.Number:
|
|
143
140
|
"""Returns the area of the feature's default geometry.
|
|
144
141
|
|
|
@@ -160,8 +157,8 @@ class Feature(element.Element):
|
|
|
160
157
|
def bounds(
|
|
161
158
|
self,
|
|
162
159
|
# pylint: disable-next=invalid-name
|
|
163
|
-
maxError:
|
|
164
|
-
proj:
|
|
160
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
161
|
+
proj: _arg_types.Projection | None = None,
|
|
165
162
|
) -> Feature:
|
|
166
163
|
"""Returns a feature containing the bounding box of the geometry.
|
|
167
164
|
|
|
@@ -180,8 +177,8 @@ class Feature(element.Element):
|
|
|
180
177
|
self,
|
|
181
178
|
distance: _arg_types.Number,
|
|
182
179
|
# pylint: disable-next=invalid-name
|
|
183
|
-
maxError:
|
|
184
|
-
proj:
|
|
180
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
181
|
+
proj: _arg_types.Projection | None = None,
|
|
185
182
|
) -> Feature:
|
|
186
183
|
"""Returns the input buffered by a given distance.
|
|
187
184
|
|
|
@@ -208,8 +205,8 @@ class Feature(element.Element):
|
|
|
208
205
|
def centroid(
|
|
209
206
|
self,
|
|
210
207
|
# pylint: disable-next=invalid-name
|
|
211
|
-
maxError:
|
|
212
|
-
proj:
|
|
208
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
209
|
+
proj: _arg_types.Projection | None = None,
|
|
213
210
|
) -> Feature:
|
|
214
211
|
"""Returns a point at the center.
|
|
215
212
|
|
|
@@ -234,8 +231,8 @@ class Feature(element.Element):
|
|
|
234
231
|
self,
|
|
235
232
|
right: _arg_types.Element,
|
|
236
233
|
# pylint: disable-next=invalid-name
|
|
237
|
-
maxError:
|
|
238
|
-
proj:
|
|
234
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
235
|
+
proj: _arg_types.Projection | None = None,
|
|
239
236
|
) -> computedobject.ComputedObject:
|
|
240
237
|
"""Returns the point on the right input that is nearest to the left input.
|
|
241
238
|
|
|
@@ -261,8 +258,8 @@ class Feature(element.Element):
|
|
|
261
258
|
self,
|
|
262
259
|
right: _arg_types.Element,
|
|
263
260
|
# pylint: disable-next=invalid-name
|
|
264
|
-
maxError:
|
|
265
|
-
proj:
|
|
261
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
262
|
+
proj: _arg_types.Projection | None = None,
|
|
266
263
|
) -> computedobject.ComputedObject:
|
|
267
264
|
"""Returns the points on the right input that are nearest to the left input.
|
|
268
265
|
|
|
@@ -292,8 +289,8 @@ class Feature(element.Element):
|
|
|
292
289
|
self,
|
|
293
290
|
right: _arg_types.Any,
|
|
294
291
|
# pylint: disable-next=invalid-name
|
|
295
|
-
maxError:
|
|
296
|
-
proj:
|
|
292
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
293
|
+
proj: _arg_types.Projection | None = None,
|
|
297
294
|
) -> computedobject.ComputedObject:
|
|
298
295
|
"""Returns true if the geometry is contained in the geometry of another.
|
|
299
296
|
|
|
@@ -318,8 +315,8 @@ class Feature(element.Element):
|
|
|
318
315
|
self,
|
|
319
316
|
right: _arg_types.Any,
|
|
320
317
|
# pylint: disable-next=invalid-name
|
|
321
|
-
maxError:
|
|
322
|
-
proj:
|
|
318
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
319
|
+
proj: _arg_types.Projection | None = None,
|
|
323
320
|
) -> computedobject.ComputedObject:
|
|
324
321
|
"""Returns true if the geometry contains the geometry of another.
|
|
325
322
|
|
|
@@ -343,8 +340,8 @@ class Feature(element.Element):
|
|
|
343
340
|
def convexHull(
|
|
344
341
|
self,
|
|
345
342
|
# pylint: disable-next=invalid-name
|
|
346
|
-
maxError:
|
|
347
|
-
proj:
|
|
343
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
344
|
+
proj: _arg_types.Projection | None = None,
|
|
348
345
|
) -> Feature:
|
|
349
346
|
"""Returns the convex hull of the original geometry.
|
|
350
347
|
|
|
@@ -369,8 +366,8 @@ class Feature(element.Element):
|
|
|
369
366
|
self,
|
|
370
367
|
distances: _arg_types.List,
|
|
371
368
|
# pylint: disable-next=invalid-name
|
|
372
|
-
maxError:
|
|
373
|
-
proj:
|
|
369
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
370
|
+
proj: _arg_types.Projection | None = None,
|
|
374
371
|
) -> Feature:
|
|
375
372
|
"""Returns a feature containing the cut lines.
|
|
376
373
|
|
|
@@ -398,8 +395,8 @@ class Feature(element.Element):
|
|
|
398
395
|
self,
|
|
399
396
|
right: _arg_types.Any,
|
|
400
397
|
# pylint: disable-next=invalid-name
|
|
401
|
-
maxError:
|
|
402
|
-
proj:
|
|
398
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
399
|
+
proj: _arg_types.Projection | None = None,
|
|
403
400
|
) -> Feature:
|
|
404
401
|
"""Returns the geometry of the feature minus the 'right' geometry.
|
|
405
402
|
|
|
@@ -425,8 +422,8 @@ class Feature(element.Element):
|
|
|
425
422
|
self,
|
|
426
423
|
right: _arg_types.Any,
|
|
427
424
|
# pylint: disable-next=invalid-name
|
|
428
|
-
maxError:
|
|
429
|
-
proj:
|
|
425
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
426
|
+
proj: _arg_types.Projection | None = None,
|
|
430
427
|
) -> computedobject.ComputedObject:
|
|
431
428
|
"""Returns true if and only if the feature geometries are disjoint.
|
|
432
429
|
|
|
@@ -450,8 +447,8 @@ class Feature(element.Element):
|
|
|
450
447
|
def dissolve(
|
|
451
448
|
self,
|
|
452
449
|
# pylint: disable-next=invalid-name
|
|
453
|
-
maxError:
|
|
454
|
-
proj:
|
|
450
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
451
|
+
proj: _arg_types.Projection | None = None,
|
|
455
452
|
) -> Feature:
|
|
456
453
|
"""Returns a feature containing the union of the geometry of a feature.
|
|
457
454
|
|
|
@@ -472,9 +469,9 @@ class Feature(element.Element):
|
|
|
472
469
|
self,
|
|
473
470
|
right: _arg_types.Any,
|
|
474
471
|
# pylint: disable-next=invalid-name
|
|
475
|
-
maxError:
|
|
476
|
-
proj:
|
|
477
|
-
spherical:
|
|
472
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
473
|
+
proj: _arg_types.Projection | None = None,
|
|
474
|
+
spherical: _arg_types.Bool | None = None,
|
|
478
475
|
) -> ee_number.Number:
|
|
479
476
|
"""Returns the minimum distance between the geometries of two features.
|
|
480
477
|
|
|
@@ -498,10 +495,10 @@ class Feature(element.Element):
|
|
|
498
495
|
def geometry(
|
|
499
496
|
self,
|
|
500
497
|
# pylint: disable-next=invalid-name
|
|
501
|
-
maxError:
|
|
502
|
-
proj:
|
|
503
|
-
geodesics:
|
|
504
|
-
) ->
|
|
498
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
499
|
+
proj: _arg_types.Projection | None = None,
|
|
500
|
+
geodesics: _arg_types.Bool | None = None,
|
|
501
|
+
) -> geometry.Geometry:
|
|
505
502
|
"""Returns the geometry of a given feature in a given projection.
|
|
506
503
|
|
|
507
504
|
Args:
|
|
@@ -521,10 +518,10 @@ class Feature(element.Element):
|
|
|
521
518
|
|
|
522
519
|
def hersDescriptor(
|
|
523
520
|
self,
|
|
524
|
-
selectors:
|
|
525
|
-
buckets:
|
|
521
|
+
selectors: _arg_types.List | None = None,
|
|
522
|
+
buckets: _arg_types.Integer | None = None,
|
|
526
523
|
# pylint: disable-next=invalid-name
|
|
527
|
-
peakWidthScale:
|
|
524
|
+
peakWidthScale: _arg_types.Number | None = None,
|
|
528
525
|
) -> dictionary.Dictionary:
|
|
529
526
|
"""Returns a dictionary of Histogram Error Ring Statistic (HERS) arrays.
|
|
530
527
|
|
|
@@ -560,8 +557,8 @@ class Feature(element.Element):
|
|
|
560
557
|
self,
|
|
561
558
|
right: _arg_types.Any,
|
|
562
559
|
# pylint: disable-next=invalid-name
|
|
563
|
-
maxError:
|
|
564
|
-
proj:
|
|
560
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
561
|
+
proj: _arg_types.Projection | None = None,
|
|
565
562
|
) -> Feature:
|
|
566
563
|
"""Returns the intersection of the geometries with right.
|
|
567
564
|
|
|
@@ -589,8 +586,8 @@ class Feature(element.Element):
|
|
|
589
586
|
self,
|
|
590
587
|
right: _arg_types.Any,
|
|
591
588
|
# pylint: disable-next=invalid-name
|
|
592
|
-
maxError:
|
|
593
|
-
proj:
|
|
589
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
590
|
+
proj: _arg_types.Projection | None = None,
|
|
594
591
|
) -> computedobject.ComputedObject:
|
|
595
592
|
"""Returns true if and only if the feature geometries intersect.
|
|
596
593
|
|
|
@@ -614,8 +611,8 @@ class Feature(element.Element):
|
|
|
614
611
|
def length(
|
|
615
612
|
self,
|
|
616
613
|
# pylint: disable-next=invalid-name
|
|
617
|
-
maxError:
|
|
618
|
-
proj:
|
|
614
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
615
|
+
proj: _arg_types.Projection | None = None,
|
|
619
616
|
) -> ee_number.Number:
|
|
620
617
|
"""Returns the length of the linear parts of the geometry of a feature.
|
|
621
618
|
|
|
@@ -636,8 +633,8 @@ class Feature(element.Element):
|
|
|
636
633
|
def perimeter(
|
|
637
634
|
self,
|
|
638
635
|
# pylint: disable-next=invalid-name
|
|
639
|
-
maxError:
|
|
640
|
-
proj:
|
|
636
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
637
|
+
proj: _arg_types.Projection | None = None,
|
|
641
638
|
) -> ee_number.Number:
|
|
642
639
|
"""Returns the length of the perimeter of the polygonal parts of the geometry of a given feature.
|
|
643
640
|
|
|
@@ -659,8 +656,8 @@ class Feature(element.Element):
|
|
|
659
656
|
self,
|
|
660
657
|
# pylint: disable=invalid-name
|
|
661
658
|
propertySelectors: _arg_types.List,
|
|
662
|
-
newProperties:
|
|
663
|
-
retainGeometry:
|
|
659
|
+
newProperties: _arg_types.List | None = None,
|
|
660
|
+
retainGeometry: _arg_types.Bool | None = None,
|
|
664
661
|
# pylint: enable=invalid-name
|
|
665
662
|
) -> Feature:
|
|
666
663
|
"""Returns a feature with the selected properties.
|
|
@@ -685,7 +682,7 @@ class Feature(element.Element):
|
|
|
685
682
|
)
|
|
686
683
|
|
|
687
684
|
def setGeometry(
|
|
688
|
-
self, geometry:
|
|
685
|
+
self, geometry: _arg_types.Geometry | None = None
|
|
689
686
|
) -> Feature:
|
|
690
687
|
"""Returns the feature with the geometry replaced by the specified geometry.
|
|
691
688
|
|
|
@@ -701,7 +698,7 @@ class Feature(element.Element):
|
|
|
701
698
|
self,
|
|
702
699
|
# pylint: disable-next=invalid-name
|
|
703
700
|
maxError: _arg_types.ErrorMargin,
|
|
704
|
-
proj:
|
|
701
|
+
proj: _arg_types.Projection | None = None,
|
|
705
702
|
) -> Feature:
|
|
706
703
|
"""Returns a feature with geometry simplified to within an error margin.
|
|
707
704
|
|
|
@@ -732,8 +729,8 @@ class Feature(element.Element):
|
|
|
732
729
|
self,
|
|
733
730
|
right: _arg_types.Any,
|
|
734
731
|
# pylint: disable-next=invalid-name
|
|
735
|
-
maxError:
|
|
736
|
-
proj:
|
|
732
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
733
|
+
proj: _arg_types.Projection | None = None,
|
|
737
734
|
) -> Feature:
|
|
738
735
|
"""Returns a feature containing the symmetric difference with right.
|
|
739
736
|
|
|
@@ -766,9 +763,9 @@ class Feature(element.Element):
|
|
|
766
763
|
|
|
767
764
|
def transform(
|
|
768
765
|
self,
|
|
769
|
-
proj:
|
|
766
|
+
proj: _arg_types.Projection | None = None,
|
|
770
767
|
# pylint: disable-next=invalid-name
|
|
771
|
-
maxError:
|
|
768
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
772
769
|
) -> Feature:
|
|
773
770
|
"""Transforms the geometry of a feature to a specific projection.
|
|
774
771
|
|
|
@@ -791,8 +788,8 @@ class Feature(element.Element):
|
|
|
791
788
|
self,
|
|
792
789
|
right: _arg_types.Any,
|
|
793
790
|
# pylint: disable-next=invalid-name
|
|
794
|
-
maxError:
|
|
795
|
-
proj:
|
|
791
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
792
|
+
proj: _arg_types.Projection | None = None,
|
|
796
793
|
) -> Feature:
|
|
797
794
|
"""Returns a feature containing the union of the geometries of two features.
|
|
798
795
|
|
|
@@ -815,8 +812,8 @@ class Feature(element.Element):
|
|
|
815
812
|
right: _arg_types.Any,
|
|
816
813
|
distance: _arg_types.Number,
|
|
817
814
|
# pylint: disable-next=invalid-name
|
|
818
|
-
maxError:
|
|
819
|
-
proj:
|
|
815
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
816
|
+
proj: _arg_types.Projection | None = None,
|
|
820
817
|
) -> computedobject.ComputedObject:
|
|
821
818
|
"""Returns true if the geometries of right are within a specified distance.
|
|
822
819
|
|
ee/featurecollection.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import Any
|
|
8
|
+
from typing import Any
|
|
9
9
|
|
|
10
10
|
from ee import _arg_types
|
|
11
11
|
from ee import _utils
|
|
@@ -22,7 +22,7 @@ from ee import geometry
|
|
|
22
22
|
from ee import image
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
class FeatureCollection(collection.Collection):
|
|
25
|
+
class FeatureCollection(collection.Collection[feature.Feature]):
|
|
26
26
|
"""A representation of a FeatureCollection."""
|
|
27
27
|
|
|
28
28
|
_initialized = False
|
|
@@ -34,25 +34,26 @@ class FeatureCollection(collection.Collection):
|
|
|
34
34
|
@deprecation.WarnForDeprecatedAsset('args')
|
|
35
35
|
def __init__(
|
|
36
36
|
self,
|
|
37
|
-
args:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
],
|
|
47
|
-
column: Optional[Any] = None,
|
|
37
|
+
args: None | (
|
|
38
|
+
dict[str, Any] |
|
|
39
|
+
list[Any] |
|
|
40
|
+
str |
|
|
41
|
+
feature.Feature |
|
|
42
|
+
geometry.Geometry |
|
|
43
|
+
computedobject.ComputedObject
|
|
44
|
+
),
|
|
45
|
+
column: Any | None = None,
|
|
48
46
|
):
|
|
49
47
|
"""Constructs a collection features.
|
|
50
48
|
|
|
51
49
|
Args:
|
|
52
|
-
args: constructor argument.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
args: constructor argument. One of:
|
|
51
|
+
1) A string - assumed to be the name of a collection.
|
|
52
|
+
2) A geometry.
|
|
53
|
+
3) A feature.
|
|
54
|
+
4) An array of features.
|
|
55
|
+
5) A GeoJSON FeatureCollection.
|
|
56
|
+
6) A computed object - reinterpreted as a collection.
|
|
56
57
|
column: The name of the geometry column to use. Only useful with the
|
|
57
58
|
string constructor.
|
|
58
59
|
|
|
@@ -116,8 +117,8 @@ class FeatureCollection(collection.Collection):
|
|
|
116
117
|
cls._initialized = False
|
|
117
118
|
|
|
118
119
|
def getMapId(
|
|
119
|
-
self, vis_params:
|
|
120
|
-
) ->
|
|
120
|
+
self, vis_params: dict[str, Any] | None = None
|
|
121
|
+
) -> dict[str, Any]:
|
|
121
122
|
"""Fetch and return a map id and token, suitable for use in a Map overlay.
|
|
122
123
|
|
|
123
124
|
Args:
|
|
@@ -137,9 +138,9 @@ class FeatureCollection(collection.Collection):
|
|
|
137
138
|
|
|
138
139
|
def getDownloadURL(
|
|
139
140
|
self,
|
|
140
|
-
filetype:
|
|
141
|
-
selectors:
|
|
142
|
-
filename:
|
|
141
|
+
filetype: str | None = None,
|
|
142
|
+
selectors: Any | None = None,
|
|
143
|
+
filename: str | None = None,
|
|
143
144
|
) -> str:
|
|
144
145
|
"""Gets a download URL.
|
|
145
146
|
|
|
@@ -179,8 +180,8 @@ class FeatureCollection(collection.Collection):
|
|
|
179
180
|
def select(
|
|
180
181
|
self,
|
|
181
182
|
propertySelectors: Any,
|
|
182
|
-
newProperties:
|
|
183
|
-
retainGeometry:
|
|
183
|
+
newProperties: Any | None = None,
|
|
184
|
+
retainGeometry: bool | str = True,
|
|
184
185
|
*args,
|
|
185
186
|
) -> FeatureCollection:
|
|
186
187
|
"""Select properties from each feature in a collection.
|
|
@@ -189,9 +190,9 @@ class FeatureCollection(collection.Collection):
|
|
|
189
190
|
propertySelectors: An array of names or regexes specifying the properties
|
|
190
191
|
to select.
|
|
191
192
|
newProperties: An array of strings specifying the new names for the
|
|
192
|
-
selected properties.
|
|
193
|
+
selected properties. If supplied, the length must match the number
|
|
193
194
|
of properties selected.
|
|
194
|
-
retainGeometry: A boolean.
|
|
195
|
+
retainGeometry: A boolean. When false, the result will have no geometry.
|
|
195
196
|
*args: Selector elements as varargs.
|
|
196
197
|
|
|
197
198
|
Returns:
|
|
@@ -218,14 +219,14 @@ class FeatureCollection(collection.Collection):
|
|
|
218
219
|
return 'FeatureCollection'
|
|
219
220
|
|
|
220
221
|
@staticmethod
|
|
221
|
-
def elementType() ->
|
|
222
|
+
def elementType() -> type[feature.Feature]:
|
|
222
223
|
return feature.Feature
|
|
223
224
|
|
|
224
225
|
def classify(
|
|
225
226
|
self,
|
|
226
227
|
classifier: _arg_types.Classifier,
|
|
227
228
|
# pylint: disable-next=invalid-name
|
|
228
|
-
outputName:
|
|
229
|
+
outputName: _arg_types.String | None = None,
|
|
229
230
|
) -> FeatureCollection:
|
|
230
231
|
"""Returns the result of classifying each feature in a collection.
|
|
231
232
|
|
|
@@ -246,7 +247,7 @@ class FeatureCollection(collection.Collection):
|
|
|
246
247
|
self,
|
|
247
248
|
clusterer: _arg_types.Clusterer,
|
|
248
249
|
# pylint: disable-next=invalid-name
|
|
249
|
-
outputName:
|
|
250
|
+
outputName: _arg_types.String | None = None,
|
|
250
251
|
) -> FeatureCollection:
|
|
251
252
|
"""Returns the results of clustering each feature in a collection.
|
|
252
253
|
|
|
@@ -268,8 +269,8 @@ class FeatureCollection(collection.Collection):
|
|
|
268
269
|
propertyName: _arg_types.String, # pylint: disable=invalid-name
|
|
269
270
|
mean: _arg_types.Number,
|
|
270
271
|
stdDev: _arg_types.Number, # pylint: disable=invalid-name
|
|
271
|
-
gamma:
|
|
272
|
-
reducer:
|
|
272
|
+
gamma: _arg_types.Number | None = None,
|
|
273
|
+
reducer: _arg_types.Reducer | None = None,
|
|
273
274
|
) -> image.Image:
|
|
274
275
|
"""Returns an inverse-distance weighted estimate of the value at each pixel.
|
|
275
276
|
|
|
@@ -302,8 +303,8 @@ class FeatureCollection(collection.Collection):
|
|
|
302
303
|
sill: _arg_types.Number,
|
|
303
304
|
nugget: _arg_types.Number,
|
|
304
305
|
# pylint: disable-next=invalid-name
|
|
305
|
-
maxDistance:
|
|
306
|
-
reducer:
|
|
306
|
+
maxDistance: _arg_types.Number | None = None,
|
|
307
|
+
reducer: _arg_types.Reducer | None = None,
|
|
307
308
|
) -> image.Image:
|
|
308
309
|
"""Returns the results of sampling a Kriging estimator at each pixel.
|
|
309
310
|
|
|
@@ -334,7 +335,7 @@ class FeatureCollection(collection.Collection):
|
|
|
334
335
|
@staticmethod
|
|
335
336
|
def loadBigQueryTable(
|
|
336
337
|
table: _arg_types.String,
|
|
337
|
-
geometryColumn:
|
|
338
|
+
geometryColumn: _arg_types.String | None = None,
|
|
338
339
|
) -> FeatureCollection:
|
|
339
340
|
"""Returns a FeatureCollection containing data read from a BigQuery table.
|
|
340
341
|
|
|
@@ -353,7 +354,7 @@ class FeatureCollection(collection.Collection):
|
|
|
353
354
|
def makeArray(
|
|
354
355
|
self,
|
|
355
356
|
properties: _arg_types.List,
|
|
356
|
-
name:
|
|
357
|
+
name: _arg_types.String | None = None,
|
|
357
358
|
) -> FeatureCollection:
|
|
358
359
|
"""Returns a collection with a 1-D Array property for each feature.
|
|
359
360
|
|
|
@@ -376,10 +377,10 @@ class FeatureCollection(collection.Collection):
|
|
|
376
377
|
@staticmethod
|
|
377
378
|
def randomPoints(
|
|
378
379
|
region: geometry.Geometry,
|
|
379
|
-
points:
|
|
380
|
-
seed:
|
|
380
|
+
points: _arg_types.Integer | None = None,
|
|
381
|
+
seed: _arg_types.Integer | None = None,
|
|
381
382
|
# pylint: disable-next=invalid-name
|
|
382
|
-
maxError:
|
|
383
|
+
maxError: _arg_types.ErrorMargin | None = None,
|
|
383
384
|
) -> FeatureCollection:
|
|
384
385
|
"""Returns a collection of random points.
|
|
385
386
|
|
|
@@ -407,8 +408,8 @@ class FeatureCollection(collection.Collection):
|
|
|
407
408
|
@staticmethod
|
|
408
409
|
def runBigQuery(
|
|
409
410
|
query: _arg_types.String,
|
|
410
|
-
geometryColumn:
|
|
411
|
-
maxBytesBilled:
|
|
411
|
+
geometryColumn: _arg_types.String | None = None,
|
|
412
|
+
maxBytesBilled: _arg_types.Integer | None = int(1e11),
|
|
412
413
|
) -> FeatureCollection:
|
|
413
414
|
"""Returns a FeatureCollection containing result of a BigQuery query.
|
|
414
415
|
|