공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 액세스 권한을 유지하기 위해
비상업용 자격 요건을 인증해야 합니다. 2025년 9월 26일까지 인증하지 않으면 액세스가 보류될 수 있습니다.
ee.FeatureCollection.randomPoints
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
지정된 도형에서 균일하게 무작위인 점을 생성합니다. 도형이 2차원 (다각형 또는 다중 다각형)인 경우 반환된 점은 구체의 지정된 영역에 균등하게 분포됩니다. 도형이 1차원 (유도선)인 경우 반환된 점은 도형의 가장자리에 따라 균일하게 보간됩니다. 도형의 차원이 0인 경우 (점) 반환된 점은 입력 점으로부터 균일하게 샘플링됩니다. 혼합된 측정기준의 다중 도형이 주어지면 가장 큰 측정기준을 가진 구성요소 도형에서 점이 샘플링됩니다.
| 사용 | 반환 값 |
|---|
ee.FeatureCollection.randomPoints(region, points, seed, maxError) | FeatureCollection |
| 인수 | 유형 | 세부정보 |
|---|
region | 도형 | 점을 생성할 영역입니다. |
points | 정수, 기본값: 1,000 | 생성할 포인트 수입니다. |
seed | 긴, 기본값: 0 | 랜덤 숫자 생성기의 시드입니다. |
maxError | ErrorMargin(선택사항) | 필요한 재프로젝션을 실행할 때 허용되는 최대 오류입니다. |
예
코드 편집기 (JavaScript)
// An ee.Geometry to constrain the geographic bounds of random points.
var region = ee.Geometry.Rectangle(
{coords: [-113.5, 40.0, -110.2, 41.9], geodesic: false});
// Generate 50 random points with the region.
var randomPoints = ee.FeatureCollection.randomPoints(
{region: region, points: 50, seed: 0, maxError: 1});
print('Random points from within the defined region', randomPoints);
Map.setCenter(-111.802, 40.979, 7);
Map.addLayer(region, {color: 'yellow'}, 'Region');
Map.addLayer(randomPoints, {color: 'black'}, 'Random points');
Python 설정
Python API 및 대화형 개발을 위한 geemap 사용에 관한 자세한 내용은
Python 환경 페이지를 참고하세요.
import ee
import geemap.core as geemap
Colab (Python)
# An ee.Geometry to constrain the geographic bounds of random points.
region = ee.Geometry.Rectangle(
coords=[-113.5, 40.0, -110.2, 41.9], proj='EPSG:4326', geodesic=False
)
# Generate 50 random points with the region.
random_points = ee.FeatureCollection.randomPoints(
region=region, points=50, seed=0, maxError=1
)
display('Random points from within the defined region', random_points)
m = geemap.Map()
m.set_center(-111.802, 40.979, 7)
m.add_layer(region, {'color': 'yellow'}, 'Region')
m.add_layer(random_points, {'color': 'black'}, 'Random points')
m
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],["The `ee.FeatureCollection.randomPoints` function generates a specified number of random points within a given geometry. The points are uniformly distributed within the geometry's area if it's two-dimensional, along its edges if one-dimensional, or sampled from the input points if zero-dimensional. For mixed-dimension multi-geometries, points are drawn from the highest-dimension components. The user defines the `region`, the number of `points`, a random `seed`, and an optional `maxError`.\n"]]