공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 액세스 권한을 유지하기 위해
비상업용 자격 요건을 인증해야 합니다. 2025년 9월 26일까지 인증하지 않으면 액세스가 보류될 수 있습니다.
ee.Image.remap
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
두 개의 병렬 목록으로 표시되는 입력 값에서 출력 값으로의 매핑입니다. 입력 목록에 포함되지 않은 입력 값은 defaultValue가 제공된 경우 defaultValue로 설정되고 그렇지 않은 경우 마스크 처리됩니다. 부동 소수점 값을 포함하는 입력은 부동 소수점 정밀도 오류로 인해 일치하지 않을 수 있습니다.
| 사용 | 반환 값 |
|---|
Image.remap(from, to, defaultValue, bandName) | 이미지 |
| 인수 | 유형 | 세부정보 |
|---|
다음과 같은 경우: image | 이미지 | 리매핑이 적용되는 이미지입니다. |
from | 목록 | 소스 값 (숫자 또는 ee.Array)입니다. 이 목록의 모든 값은 'to'의 해당 값에 매핑됩니다. |
to | 목록 | 대상 값 (숫자 또는 ee.Array)입니다. 이러한 값은 'from'의 해당 값을 대체하는 데 사용됩니다. 'from'과 동일한 수의 값이 있어야 합니다. |
defaultValue | 객체, 기본값: null | 'from'의 값과 일치하지 않는 값을 대체하는 기본값입니다. 지정하지 않으면 일치하지 않는 값이 마스크 처리됩니다. |
bandName | 문자열, 기본값: null | 리매핑할 밴드의 이름입니다. 지정하지 않으면 이미지의 첫 번째 밴드가 사용됩니다. |
예
코드 편집기 (JavaScript)
// A land cover image.
var img = ee.Image('ESA/WorldCover/v100/2020');
// A list of pixel values to replace.
var fromList = [10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100];
// A corresponding list of replacement values (10 becomes 1, 20 becomes 2, etc).
var toList = [ 1, 2, 2, 2, 3, 2, 4, 5, 6, 6, 2];
// Replace pixel values in the image. If the image is multi-band, only the
// remapped band will be returned. The returned band name is "remapped".
// Input image properties are retained in the output image.
var imgRemap = img.remap({
from: fromList,
to: toList,
defaultValue: 0,
bandName: 'Map'
});
// Display the original and remapped images. Note that similar land cover
// classes in the original image are grouped into aggregate classes by
// from → to value mapping.
Map.addLayer(img, null, 'Original image');
Map.addLayer(imgRemap, {
min: 1, max: 6,
palette:'darkgreen, lightgreen, red, white, blue, lightblue'
}, 'Remapped image');
Python 설정
Python API 및 geemap를 사용한 대화형 개발에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
# A land cover image.
img = ee.Image('ESA/WorldCover/v100/2020')
# A list of pixel values to replace.
from_list = [10, 20, 30, 40, 50, 60, 70, 80, 90, 95, 100]
# A corresponding list of replacement values (10 becomes 1, 20 becomes 2, etc).
to_list = [1, 2, 2, 2, 3, 2, 4, 5, 6, 6, 2]
# Replace pixel values in the image. If the image is multi-band, only the
# remapped band will be returned. The returned band name is "remapped".
# Input image properties are retained in the output image.
img_remap = img.remap(from_list, to_list, defaultValue=0, bandName='Map')
# Display the original and remapped images. Note that similar land cover
# classes in the original image are grouped into aggregate classes by
# from → to value mapping.
m = geemap.Map()
m.add_layer(img, None, 'Original image')
m.add_layer(
img_remap,
{
'min': 1,
'max': 6,
'palette': [
'darkgreen',
'lightgreen',
'red',
'white',
'blue',
'lightblue',
],
},
'Remapped image',
)
m
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[],["The `Image.remap` function replaces pixel values in an image based on two parallel lists: `from` and `to`. Values in `from` are mapped to corresponding values in `to`. Unmatched values are set to `defaultValue` if provided, otherwise they are masked. The function allows users to specify a `bandName`. It is designed to aggregate similar classes by mapping original values to new values, the remapped band name is \"remapped\".\n"]]