AnalysisSlope

경사도 분석 클래스.
Slope analysis class.

new Ditap.AnalysisSlope(viewer, options)

Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
options Object optional 옵션.
Options.
Name Type Default Description
slopeType string 'slope' optional 경사도 분석 타입 ('slope' 또는 'aspect').
Slope analysis type ('slope' or 'aspect').
positions Array.<Cartesian3> [] optional 분석할 영역의 위치 배열.
Array of positions for the analysis area.
gridSize number 10 optional 그리드 셀의 크기(미터).
Size of grid cells in meters.
startColor Color optional 가장 낮은 경사도 그리드 색상.
Start color.
midColor Color optional 중간 경사도 그리드 색상.
Middle color.
endColor Color optional 가장 높은 경사도 그리드 색상.
End color.
Example:
// 샌드캐슬 예제 'DiTAP - Slope' 참조
  
const getUrlFromBase64 = (base64Data) => {
  const b64Data = base64Data;
  const byteCharacters = window.atob(b64Data);
  const byteNumbers = new Array(byteCharacters.length);
  for (let i = 0; i < byteCharacters.length; i++) {
    byteNumbers[i] = byteCharacters.charCodeAt(i);
  }
  const byteArray = new Uint8Array(byteNumbers);
  const blob = new Blob([byteArray], { type: "image/png" });

  return URL.createObjectURL(blob);
};

const viewer = new Ditap.DitapViewer("ditapContainer", {
  fullscreenButton: true,
  baseLayerPicker: true,
  // 지형(터레인 지정)
  // 디폴트 지형 : Ditap Korea Terrain
  terrainProviderViewModels: [
    new Ditap.ProviderViewModel({
      name: "Ditap Korea Terrain",
      iconUrl: getUrlFromBase64(Ditap.ConstantUrl.DITAP_TERRAIN_IMG_URL),
      tooltip: "WGS84 standard ellipsoid, also known as EPSG:4326",
      category: "Ditap",
      creationFunction: () => {
        return Ditap.NationwideTerrainProvider.create();
      },
    }),
  ],
});
// 경사도 분석 팝업 생성
const PopupAnalysisSlope = new Ditap.PopupAnalysisSlope(viewer);

// 경사도 분석 팝업 실행
PopupAnalysisSlope.open();

Members

endColor

높은 경사도 그리드 색상.
Set the end color.

gridSize

그리드 셀의 크기.
Set the size of the grid cell.

midColor

중간 경사도 그리드 색상.
Set the mid color.

positions

분석할 영역의 위치 배열.
Set the positions of the analysis area.

slopeType

경사도 분석 타입 설정('slope' 또는 'aspect').
Set slope analysis type.

startColor

낮은 경사도 그리드 색상.
Set the start color.

Methods

async createEntity(positions)

경사도 분석을 위한 엔티티들을 생성하고 분석을 수행합니다.
Creates entities for slope analysis and performs the analysis.
Name Type Description
positions Array.<Cesium.Cartesian3> 분석할 영역의 위치 배열.
Array of positions for the analysis area.

destroy()

인스턴스 파괴.
Destroy the instance.

updateGradientColors(startColor, middleColor, endColor)

세 개의 색상으로 그라데이션을 생성하여 defaultColors를 업데이트합니다.
Name Type Description
startColor Cesium.Color 시작 색상
middleColor Cesium.Color 중간 색상
endColor Cesium.Color 끝 색상