ee.FeatureCollection.sort

지정된 속성별로 컬렉션을 정렬합니다.

정렬된 컬렉션을 반환합니다.

사용반환 값
FeatureCollection.sort(property, ascending)컬렉션
인수유형세부정보
다음과 같은 경우: collection컬렉션컬렉션 인스턴스입니다.
property문자열정렬할 속성입니다.
ascending불리언, 선택사항오름차순으로 정렬할지 내림차순으로 정렬할지입니다. 기본값은 true (오름차순)입니다.

코드 편집기 (JavaScript)

// FeatureCollection of power plants in Belgium.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants')
             .filter('country_lg == "Belgium"');

print('Belgium power plants in ascending order by capacity',
      fc.sort('capacitymw'));

print('Belgium power plants in descending order by capacity',
      fc.sort('capacitymw', false));

Python 설정

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

import ee
import geemap.core as geemap

Colab (Python)

# FeatureCollection of power plants in Belgium.
fc = ee.FeatureCollection('WRI/GPPD/power_plants').filter(
    'country_lg == "Belgium"')

print('Belgium power plants in ascending order by capacity:',
      fc.sort('capacitymw').getInfo())

print('Belgium power plants in descending order by capacity:',
      fc.sort('capacitymw', False).getInfo())