AnalysisCrossSection

종단면/횡단면 분석 기능 클래스.
Analysis feature class for cross-sections.
이 객체는 일반적으로 직접 인스턴스화되지 않습니다. PopupAnalysisCrossSection 사용을 권장합니다.
This object is normally not instantiated directly, use PopupAnalysisCrossSection.

new Ditap.AnalysisCrossSection(viewOption)

Name Type Description
viewOption Object 횡단면 분석 옵션.
Cross-section analysis options.
Name Type Description
viewer DitapViewer 사용할 Ditap Viewer 인스턴스.
The DitapViewer instance to use.
longitudinalPositions Array.<Cartesian3> 종단면 기준선 Cartesian 배열.
Cartesian array for the longitudinal baseline.
entityColor Color optional 엔티티 색상.
Color of the entity.
crossSectionPositions Array.<Array.<Cartesian3>> optional 횡단면 선분 Cartesian 배열의 배열.
Array of Cartesian arrays for cross-section lines.
Example:
// 샌드캐슬 예제 'DiTAP - CrossSection' 참조
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", {
  baseLayerPicker: true,
  // 지형(터레인 지정)
  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: function () {
        return Ditap.NationwideTerrainProvider.create();
      },
    }),
  ],
});


// 뷰어에 추가할 데이터 생성
// 모델 위치로 카메라 이동
viewer.camera.flyTo({
  destination: Ditap.Cartesian3.fromDegrees(126.97968, 37.56363, 700),
  duration: 1,
  orientation: {
    heading: Ditap.Math.toRadians(0),
    pitch: Ditap.Math.toRadians(-50),
    roll: 0,
  },
});

// PopupAnalysisCrossSection 생성
const popup = new Ditap.PopupAnalysisCrossSection(viewer);

popup.open();

Members

crossSectionPositions : Array.<Array.<Cartesian3>>

생성된 횡단면 선분 Cartesian 배열의 배열.
Array of Cartesian arrays for the created cross-section lines.

longitudinalLength : number

종단면의 전체 길이.
Total length of the longitudinal section.

longitudinalPositions : Array.<Cartesian3>

종단면 기준선 Cartesian 배열.
Cartesian array for the longitudinal baseline.

perpendicularLength : number

횡단면의 수직 길이 (폴리라인 중심 기준 좌우 길이 합).
Perpendicular length of the cross-section (total length left and right from the polyline center).
Default Value: 50

Methods

async asyncCreateCrossSectionsByPositions()Promise.<void>

기존 횡단면 primitives의 길이를 새로운 _perpendicularLength에 맞게 수정합니다.
Returns:

async createEntity(options)Promise.<void>

종단면과 모든 횡단면의 고도 프로파일 데이터를 계산합니다.
Calculates the elevation profile data for the longitudinal section and all cross-sections.
Name Type Description
options Object 옵션 객체.
Name Type Description
offCallback function 계산 완료 후 결과 데이터를 전달받을 콜백 함수.
Callback function to receive the result data after calculation is complete.
Returns:
콜백 함수를 통해 결과가 비동기적으로 반환됩니다.
The result is returned asynchronously via the callback function.

destroy()

분석 인스턴스와 관련된 모든 Primitive를 제거하고 내부 상태를 초기화합니다.
Removes all Primitives associated with the analysis instance and resets the internal state.