본문으로 건너뛰기

공간 연산과 결과 적용

입력을 스냅숏으로 복사하고 연산 CRS에서 기하를 계산합니다. 지도 피처에서 캡처한 결과를 편집에 쓰려면 대상 레이어의 CRS로 출력해야 합니다. 계산과 속성 준비는 작업 스레드에서 수행할 수 있으며 최종 적용은 캡처와 같은 스레드와 편집 세션에서 수행합니다.

C++ 주제 그룹

.NET에서 사용하기

스냅샷을 바탕으로 기하를 계산한 뒤 속성과 함께 편집에 적용합니다. 단일 기하 연산과 지도 피처의 스냅샷·적용 워크플로를 구분합니다. 아래 예제는 기하 연산의 기초입니다.

호출 순서: 입력 캡처 → 연산/출력 CRS 지정 → 계산 → 속성 준비 → 적용.

Note

계산과 적용은 같은 작업이 아닙니다. 적용은 캡처와 같은 스레드·편집 세션에서 수행하고 대상 CRS를 맞춥니다.

개념과 사용 순서 · 관계와 처리 흐름 · .NET 시작하기

C# 실행 예제

아래는 SDK 샘플의 실제 코드 영역입니다. 초기화·오류 처리·해제를 포함한 전체 흐름은 사용 가이드에서 확인하세요.

// Operations return a new geometry that the caller disposes. An empty
// result is a result too: check IsEmpty. The buffer distance is in the
// units of the geometry's CRS.
private static bool Operations(glsVectorDataSource districts, glsVectorDataSource places,
    glsVectorDataSource roads)
{
    using (glsGeometry oldHarbor = GeometryByName(districts, "Old Harbor"))
    using (glsGeometry market = GeometryByName(districts, "Market Quarter"))
    using (glsGeometry garden = GeometryByName(districts, "Garden Quarter"))
    using (glsGeometry road = GeometryByName(roads, "Harbor Road"))
    using (glsGeometry pier = GeometryByName(places, "Lighthouse Pier"))
    {
        if (oldHarbor == null || market == null || garden == null || road == null || pier == null)
        {
            return false;
        }
        using (glsGeometry merged = oldHarbor.Union(market))
        {
            Console.WriteLine("[sample] union of Old Harbor and Market Quarter: {0}, area {1}",
                merged.GeometryType, F(merged.Area(), 6));
        }
        using (glsGeometry inside = road.Intersection(oldHarbor))
        {
            Console.WriteLine("[sample] Harbor Road inside Old Harbor: {0}, length {1}",
                inside.GeometryType, F(inside.Length(), 6));
        }
        using (glsGeometry none = road.Intersection(garden))
        {
            Console.WriteLine("[sample] Harbor Road inside Garden Quarter: empty={0}", YesNo(none.IsEmpty));
        }
        using (glsGeometry disc = pier.Buffer(0.005, 8))
        {
            Console.WriteLine("[sample] buffer of Lighthouse Pier: {0}, area {1}",
                disc.GeometryType, F(disc.Area(), 6));
            using (glsGeometry rest = oldHarbor.Difference(disc))
            {
                Console.WriteLine("[sample] Old Harbor minus the buffer: {0}, area {1}",
                    rest.GeometryType, F(rest.Area(), 6));
            }
        }
    }
    return true;
}

입력 캡처와 좌표계

glsSpatialFeatureSource

glsSpatialWkbSource

glsSpatialSnapshot

glsSpatialSnapshotService

glsSpatialRequest

공간 연산과 결과

glsSpatialOperation

glsSpatialOperationOptions

glsSpatialDistanceModel

glsSpatialDistanceUnit

glsSpatialEmptyPolicy

glsSpatialDimensionPolicy

glsSpatialCancellation

glsSpatialOperationService

glsSpatialResult

속성값 집계

glsSpatialAttributePolicy

glsSpatialAttributeAssignment

glsSpatialAttributeDefaults

glsSpatialAttributeService

편집 적용과 작업 흐름

glsSpatialApplyMode

glsSpatialApplyState

glsSpatialApplyOptions

glsSpatialApplyPlan

glsSpatialApplyResult

glsSpatialEditService

glsSpatialWorkflowDefaults

glsSpatialWorkflowProfile