AnalysisSolar

일조권 분석 및 분석 결과 시각화 클래스.
Analysis and visualization class for solar exposure (sunlight analysis).

new Ditap.AnalysisSolar(options)

Name Type Description
options Object 추가 속성이 필요한 경우 사용.
Additional properties if required.
Name Type Description
viewer DitapViewer 사용할 DitapViewer 인스턴스.
The DitapViewer instance to use.
apiKey string API 키.
API key.
animation boolean 애니메이션 여부.
Whether to use animation.
Example:
// 샌드캐슬 예제 'DiTAP - Solar' 참조
const viewer = new Ditap.DitapViewer("ditapContainer", {
  fullscreenButton: true,
  baseLayerPicker: true,
});

// 초기 카메라 위치 설정
viewer.camera.setView({
  destination: Ditap.Cartesian3.fromDegrees(
    126.9782349646649,
    37.56671536989183,
    150
  ),
  orientation: {
    heading: Ditap.Math.toRadians(0),
    roll: 0,
  },
});

// 태양 위치에 따른 그림자 효과
viewer.scene.globe.enableLighting = true;
viewer.scene.globe.shadows = true;
viewer.scene.globe.receiveShadows = true;
viewer.shadows = true;
viewer.terrainShadows = Ditap.ShadowMode.ENABLED;

// 지도 밝기 조절
viewer.scene.globe.lightingFadeOutDistance = 10000;
viewer.scene.globe.lightingFadeInDistance = 10000;

// InteractionSolar 생성
const interactionSolar = new Ditap.InteractionSolar({
  viewer: viewer,
  apiKey:
    "6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D",
  animation: true,
});

const popup = new Ditap.PopupSolarAnalysisController({
  viewer: viewer,
  apiKey:
    "6VfToXRgNMs9CnW9lKYLAUaWk%2FuHDT745Nf0HytWqOq5CE%2BbKGaaLn2%2FtI4Sx0Sh%2FZutrVvh4YQk9975%2FaQ5Xg%3D%3D",
  animation: true,
});

popup.interactionSolar = interactionSolar;

// 모델 좌표
const modelPosition = new Ditap.Cartesian3.fromDegrees(
  126.9782349646649,
  37.56671536989183,
  0
);

// 모델 행렬 생성
const modelMatrix = Ditap.Transforms.eastNorthUpToFixedFrame(modelPosition);

// 모델 인스턴스 생성
const model = await Ditap.Model.fromGltfAsync({
  id: "model_01",
  url: "../../SampleData/models/GroundVehicle/GroundVehicle.glb",
  modelMatrix: modelMatrix,
  minimumPixelSize: 128,
  maximumScale: 3.0,
  scale: 3.0,
});

// 모델 추가
viewer.scene.primitives.add(model);
popup.open();

Methods

_generateTimeSteps(startTime, endTime, intervalMinutes)Array.<JulianDate>

시작 시간과 종료 시간 사이를 intervalMinutes 간격으로 나눈 JulianDate 배열을 생성합니다.
Generates an array of JulianDate time steps between the start and end times, divided by the given interval in minutes.
Name Type Description
startTime string ISO8601 형식의 시작 시간.
Start time in ISO8601.
endTime string ISO8601 형식의 종료 시간.
End time in ISO8601.
intervalMinutes number 시간 간격(분).
Interval in minutes.
Returns:
생성된 시간 스텝 배열.
Array of JulianDate time steps.

clear()

모든 분석 결과 시각화 엔티티를 제거합니다.
Clears all visualization entities added during the analysis.

destroy()

인스턴스 파괴.
Destroy the instance.

async performAnalysis(points, startTime, endTime, intervalMinutes)Promise.<Array.<Object>>

지정된 지점들에 대해 주어진 시간 범위 내 태양 위치와 레이캐스팅을 통해 일조 여부를 판정합니다.
Determines whether each point is sunlit over the given time range by calculating the sun position and performing raycasting.
Name Type Description
points Array.<Cartesian3> 분석할 지점 배열.
Array of points to analyze.
startTime string ISO8601 형식의 시작 시간 (예: "2025-02-20T00:00:00+09:00").
Start time in ISO8601.
endTime string ISO8601 형식의 종료 시간 (예: "2025-02-20T23:59:59+09:00").
End time in ISO8601.
intervalMinutes number 시간 간격(분).
Interval in minutes.
Returns:
각 지점의 시간별 일조 여부 결과 배열.
Array of sunlight analysis results per point.

async visualizeAnalysisResult(analysisResults, sunriseStr, sunsetStr, intervalMinutes, animation)

분석 결과를 시각화합니다.
각 분석 지점에 대해, 주어진 시간 스텝마다 태양 방향으로 고정 길이의 선을 그리며, 일조 상태에 따라 선 색상과 라벨을 적용합니다.
Visualizes the analysis results.
For each analysis point, draws a short line along the sun direction at each time step, coloring the line based on the sunlight status and adding time labels at the top of each hour.
Name Type Description
analysisResults Array.<Object> AnalysisSolar.performAnalysis()의 결과 배열.
Array of results from AnalysisSolar.performAnalysis().
sunriseStr string "HHmm" 형식의 일출 시간 (예: "0630").
Sunrise time in "HHmm" format.
sunsetStr string "HHmm" 형식의 일몰 시간 (예: "1830").
Sunset time in "HHmm" format.
intervalMinutes number 시간 간격(분).
Interval in minutes.
animation boolean 애니메이션 적용 여부.
Whether to animate the visualization.