ee.Geometry.MultiLineString.simplify

지정된 오류 범위 내에서 도형을 단순화합니다. maxError가 명시적으로 null로 지정되지 않는 한 이 알고리즘의 소비자가 요청한 오류 허용 범위가 적용되지 않습니다.

이렇게 하면 오류 범위를 전파하는 기본 Earth Engine 정책이 재정의되므로 출력에서 요청된 지오메트리 정확도와 관계없이 입력은 이 알고리즘의 인수에 지정된 오류 범위로 요청됩니다. 이렇게 하면 렌더링된 벡터 지도의 모든 확대/축소 수준에서 일관된 렌더링이 이루어지지만 낮은 확대/축소 수준 (즉, 축소)에서는 지오메트리가 단순화되지 않아 성능이 저하될 수 있습니다.

사용반환 값
MultiLineString.simplify(maxError, proj)도형
인수유형세부정보
다음과 같은 경우: geometry도형단순화할 도형입니다.
maxErrorErrorMargin결과가 입력과 다를 수 있는 최대 오류량입니다.
proj예상, 기본값: null지정된 경우 결과는 이 투영에 표시됩니다. 그렇지 않으면 입력과 동일한 투영에 있습니다. 오차 범위가 예측 단위로 표시되면 오차 범위는 이 예측의 단위로 해석됩니다.

코드 편집기 (JavaScript)

// Define a MultiLineString object.
var multiLineString = ee.Geometry.MultiLineString(
   [[[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
    [[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]]]);

// Apply the simplify method to the MultiLineString object.
var multiLineStringSimplify = multiLineString.simplify({'maxError': 1});

// Print the result to the console.
print('multiLineString.simplify(...) =', multiLineStringSimplify);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(multiLineString,
             {'color': 'black'},
             'Geometry [black]: multiLineString');
Map.addLayer(multiLineStringSimplify,
             {'color': 'red'},
             'Result [red]: multiLineString.simplify');

Python 설정

Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은 Python 환경 페이지를 참고하세요.

import ee
import geemap.core as geemap

Colab (Python)

# Define a MultiLineString object.
multilinestring = ee.Geometry.MultiLineString([
    [[-122.088, 37.418], [-122.086, 37.422], [-122.082, 37.418]],
    [[-122.087, 37.416], [-122.083, 37.416], [-122.082, 37.419]],
])

# Apply the simplify method to the MultiLineString object.
multilinestring_simplify = multilinestring.simplify(maxError=1)

# Print the result.
display('multilinestring.simplify(...) =', multilinestring_simplify)

# Display relevant geometries on the map.
m = geemap.Map()
m.set_center(-122.085, 37.422, 15)
m.add_layer(
    multilinestring, {'color': 'black'}, 'Geometry [black]: multilinestring'
)
m.add_layer(
    multilinestring_simplify,
    {'color': 'red'},
    'Result [red]: multilinestring.simplify',
)
m