ee.Feature.distance
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Zwraca minimalną odległość między geometriami 2 elementów.
Wykorzystanie | Zwroty |
---|
Feature.distance(right, maxError, proj, spherical) | Liczba zmiennoprzecinkowa |
Argument | Typ | Szczegóły |
---|
to: left | Element | Obiekt zawierający geometrię użytą jako lewy operand operacji. |
right | Element | Obiekt zawierający geometrię używaną jako prawy operand operacji. |
maxError | ErrorMargin, domyślnie: null | Maksymalny dopuszczalny błąd podczas wykonywania niezbędnej projekcji wstecznej. |
proj | Prognoza, domyślnie: NULL | Projekcja, w której ma być wykonywana operacja. Jeśli nie zostanie podany, operacja zostanie wykonana w układzie współrzędnych sferycznych, a odległości liniowe będą podawane w metrach na sferze. |
spherical | Wartość logiczna, domyślnie: false (fałsz). | Jeśli ma wartość Prawda, obliczenia zostaną wykonane na kuli jednostkowej. Jeśli wartość to fałsz, obliczenia będą eliptyczne, uwzględniające spłaszczenie Ziemi. Ta wartość jest ignorowana, jeśli określono parametr proj. Wartość domyślna to fałsz. |
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-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["\u003cp\u003eMeasures the shortest distance between two geographical features.\u003c/p\u003e\n"],["\u003cp\u003eAccepts two features as input, along with optional parameters for error margin and projection.\u003c/p\u003e\n"],["\u003cp\u003eReturns the calculated distance as a floating-point number, representing the separation between the features.\u003c/p\u003e\n"],["\u003cp\u003eIf a projection is not specified, calculations default to a spherical coordinate system with distances in meters.\u003c/p\u003e\n"],["\u003cp\u003eAllows for specifying an error margin to manage the accuracy of calculations, particularly during reprojection.\u003c/p\u003e\n"]]],[],null,["# ee.Feature.distance\n\nReturns the minimum distance between the geometries of two features.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|--------------------------------------------------------------------|---------|\n| Feature.distance`(right, `*maxError* `, `*proj* `, `*spherical*`)` | Float |\n\n| Argument | Type | Details |\n|--------------|----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `left` | Element | The feature containing the geometry used as the left operand of the operation. |\n| `right` | Element | The feature containing the geometry used as the right operand of the operation. |\n| `maxError` | ErrorMargin, default: null | The maximum amount of error tolerated when performing any necessary reprojection. |\n| `proj` | Projection, default: null | The projection in which to perform the operation. If not specified, the operation will be performed in a spherical coordinate system, and linear distances will be in meters on the sphere. |\n| `spherical` | Boolean, default: false | If true, the calculation will be done on the unit sphere. If false, the calculation will be elliptical, taking earth flattening into account. Ignored if proj is specified. Default is false. |"]]