ee.ErrorMargin
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zwraca obiekt ErrorMargin danego typu o podanej wartości.
Wykorzystanie | Zwroty |
---|
ee.ErrorMargin(value, unit) | ErrorMargin |
Argument | Typ | Szczegóły |
---|
value | Liczba zmiennoprzecinkowa, domyślnie: null | Maksymalna wartość błędu dopuszczalna przez margines. Ignorowane, jeśli jednostka to „infinite”. |
unit | Ciąg znaków, domyślnie: „meters” | Jednostka tego marginesu: „meters” (metry), „projected” (prognozowane) lub „infinite” (nieskończone). |
Przykłady
Edytor kodu (JavaScript)
// Construct a variety of error margins.
print(ee.ErrorMargin(0)); // unit: meters value: 0
print(ee.ErrorMargin(1)); // unit: meters value: 1
// Negative margin yields a positive value.
print(ee.ErrorMargin(-1)); // unit: meters value: 1
// Large values are turned into an 'infinite'
print(ee.ErrorMargin(1e8)); // unit: infinite
// A very large error margin does not quite trigger infinite, which is 2.0e7.
print(ee.ErrorMargin(1e7)); // unit: meters value: 10000000
// Being explicit about the units of the error margin.
print(ee.ErrorMargin(1, 'meters')); // unit: meters value: 1
print(ee.ErrorMargin(1, 'projected')); // unit: projected value: 1
print(ee.ErrorMargin(1, 'infinite')); // unit: infinite
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap
do interaktywnego programowania znajdziesz na stronie
Środowisko Python.
import ee
import geemap.core as geemap
Colab (Python)
# Construct a variety of error margins.
print(ee.ErrorMargin(0).getInfo()) # unit: meters value: 0
print(ee.ErrorMargin(1).getInfo()) # unit: meters value: 1
# Negative margin yields a positive value.
print(ee.ErrorMargin(-1).getInfo()) # unit: meters value: 1
# Large values are turned into an 'infinite'
print(ee.ErrorMargin(1e8).getInfo()) # unit: infinite
# A very large error margin does not quite trigger infinite, which is 2.0e7.
print(ee.ErrorMargin(1e7).getInfo()) # unit: meters value: 10000000
# Being explicit about the units of the error margin.
print(ee.ErrorMargin(1, 'meters').getInfo()) # unit: meters value: 1
print(ee.ErrorMargin(1, 'projected').getInfo()) # unit: projected value: 1
print(ee.ErrorMargin(1, 'infinite').getInfo()) # unit: infinite
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-26 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eee.ErrorMargin\u003c/code\u003e creates an object representing a margin of error for spatial operations.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts an optional \u003ccode\u003evalue\u003c/code\u003e (default: null) and \u003ccode\u003eunit\u003c/code\u003e (default: "meters") to define the margin.\u003c/p\u003e\n"],["\u003cp\u003eUnits can be 'meters', 'projected', or 'infinite', with large values (>= 2.0e7) automatically treated as 'infinite'.\u003c/p\u003e\n"],["\u003cp\u003eNegative values for \u003ccode\u003evalue\u003c/code\u003e are converted to positive values, representing the absolute error.\u003c/p\u003e\n"]]],[],null,["# ee.ErrorMargin\n\nReturns an ErrorMargin of the given type with the given value.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|----------------------------------------|-------------|\n| `ee.ErrorMargin(`*value* `, `*unit*`)` | ErrorMargin |\n\n| Argument | Type | Details |\n|----------|---------------------------|-----------------------------------------------------------------------------------|\n| `value` | Float, default: null | The maximum error value allowed by the margin. Ignored if the unit is 'infinite'. |\n| `unit` | String, default: \"meters\" | The unit of this margin: 'meters', 'projected' or 'infinite'. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Construct a variety of error margins.\nprint(ee.ErrorMargin(0)); // unit: meters value: 0\nprint(ee.ErrorMargin(1)); // unit: meters value: 1\n// Negative margin yields a positive value.\nprint(ee.ErrorMargin(-1)); // unit: meters value: 1\n// Large values are turned into an 'infinite'\nprint(ee.ErrorMargin(1e8)); // unit: infinite\n// A very large error margin does not quite trigger infinite, which is 2.0e7.\nprint(ee.ErrorMargin(1e7)); // unit: meters value: 10000000\n\n// Being explicit about the units of the error margin.\nprint(ee.ErrorMargin(1, 'meters')); // unit: meters value: 1\nprint(ee.ErrorMargin(1, 'projected')); // unit: projected value: 1\nprint(ee.ErrorMargin(1, 'infinite')); // unit: infinite\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# Construct a variety of error margins.\nprint(ee.ErrorMargin(0).getInfo()) # unit: meters value: 0\nprint(ee.ErrorMargin(1).getInfo()) # unit: meters value: 1\n# Negative margin yields a positive value.\nprint(ee.ErrorMargin(-1).getInfo()) # unit: meters value: 1\n# Large values are turned into an 'infinite'\nprint(ee.ErrorMargin(1e8).getInfo()) # unit: infinite\n# A very large error margin does not quite trigger infinite, which is 2.0e7.\nprint(ee.ErrorMargin(1e7).getInfo()) # unit: meters value: 10000000\n\n# Being explicit about the units of the error margin.\nprint(ee.ErrorMargin(1, 'meters').getInfo()) # unit: meters value: 1\nprint(ee.ErrorMargin(1, 'projected').getInfo()) # unit: projected value: 1\nprint(ee.ErrorMargin(1, 'infinite').getInfo()) # unit: infinite\n```"]]