본문으로 건너뛰기

Class VectorExportService

네임스페이스
CsGdk.WinForms.Core
어셈블리
CsGdk.WinForms.dll

지도 레이어를 벡터 파일로 내보내거나 여러 레이어를 GeoJSON 하나로 병합합니다.

public sealed class VectorExportService
상속
VectorExportService
상속된 멤버

설명

상태를 갖지 않습니다. 두 메서드는 끝날 때까지 돌아오지 않으므로 작업자 스레드에서 부릅니다.

생성자

VectorExportService()

public VectorExportService()

메서드

Export(VectorExportSource, VectorExportRequest, IProgress<glsTransferProgress>?, CancellationToken)

원본 레이어를 요청한 형식의 파일로 내보냅니다.

public VectorExportResult Export(VectorExportSource source, VectorExportRequest request, IProgress<glsTransferProgress>? progress, CancellationToken token)

매개변수

source VectorExportSource

내보낼 원본입니다. 호출이 끝날 때까지 해제하지 않아야 합니다.

request VectorExportRequest

출력 형식, 경로, 레이어 이름, 좌표 참조계, 공간 인덱스, 필드 설정입니다.

progress IProgress<glsTransferProgress>

진행을 받을 객체입니다. 단계가 바뀔 때, 직전 보고에서 100 ms 이상 지났을 때, 전체에 이르렀을 때 네이티브 전송을 실행하는 스레드에서 보고합니다. null이면 알리지 않습니다.

token CancellationToken

취소 토큰입니다. 진행 콜백이 취소를 네이티브 전송에 전달합니다.

반환값

VectorExportResult

내보내기 결과입니다. 실패와 취소도 예외 대신 결과로 돌려줍니다.

설명

출력 대상은 교체 모드(ReplaceDestination)로 씁니다. Shapefile의 String 필드 가운데 ExactStringByteWidth가 true이고 폭이 양수인 필드는 바이트 폭으로 전달합니다. 원본은 Read<T>(CancellationToken, Func<glsVectorDataSource, T>)로 읽습니다. AddToMap은 읽지 않습니다.

MergeGeoJson(IReadOnlyList<VectorExportSource>, string, IProgress<glsTransferProgress>?, CancellationToken)

여러 원본 레이어를 GeoJSON 파일 하나로 병합합니다.

public VectorExportResult MergeGeoJson(IReadOnlyList<VectorExportSource> sources, string path, IProgress<glsTransferProgress>? progress, CancellationToken token)

매개변수

sources IReadOnlyList<VectorExportSource>

병합할 원본입니다. 호출이 끝날 때까지 해제하지 않아야 합니다.

path string

출력 GeoJSON 파일 경로입니다. 확장자를 뺀 파일 이름이 출력 레이어 이름이 됩니다.

progress IProgress<glsTransferProgress>

진행을 받을 객체입니다. 네이티브가 보고할 때마다 그 스레드에서 전달합니다. null이면 알리지 않습니다.

token CancellationToken

취소 토큰입니다. 원본마다 읽기 게이트에 들어가기 전과 진행 콜백에서 확인합니다.

반환값

VectorExportResult

LayerName이 "GeoJSON"인 결과입니다. 실패와 취소도 예외 대신 결과로 돌려줍니다.

설명

병합하는 동안 모든 원본의 읽기 임대를 잡고 있으며, 읽기 전용 복제본을 열 수 있는 원본은 복제본을 읽습니다. 임대와 복제본은 호출이 끝나면 해제합니다.