데이터 편집과 저장
편집 세션은 원본 피처 ID와 세션 내 편집 ID를 구분합니다. 레이어 저장과 전체 저장은 호출 전 편집 모드를 유지합니다. 전체 저장에서 일부 레이어만 저장되면 결과에서 레이어별 상태를 확인할 수 있습니다.
.NET에서 사용하기
피처 변경을 메모리에 보류하고 되돌리거나 저장합니다. 지도 편집과 이력 관리는 EditController를 통해 수행하고, 직접 데이터 쓰기와 구별합니다.
호출 순서: 편집 가능 정보 설정 → 편집 시작 → 변경/되돌리기 → 저장 → 결과 판정.
Note
SaveLayer와 SaveAll은 저장 전 편집 모드를 보존합니다. 실패 시 결과를 확인한 뒤 재시도하며, 저장을 편집 종료로 간주하지 않습니다.
개념과 사용 순서 · 관계와 처리 흐름 · .NET 시작하기
C# 실행 예제
아래는 SDK 샘플의 실제 코드 영역입니다. 초기화·오류 처리·해제를 포함한 전체 흐름은 사용 가이드에서 확인하세요.
// SaveAll saves every layer with an edit session and returns a receipt with
// one row per layer. A layer is saved when its outcome is Committed,
// NoChanges or CommittedNeedsRefresh; judge by the outcome, not by the status
// code (CommittedNeedsRefresh carries a failed status although the data is
// saved). Edit mode stays on.
private static bool SaveAndJudge(Editing e)
{
bool placesSaved = false;
bool all;
using (glsEditSaveResult receipt = e.Controller.SaveAll(e.View))
{
foreach (glsEditLayerSaveResult row in receipt.GetLayers())
{
bool saved = row.Outcome == glsEditCommitOutcome.Committed
|| row.Outcome == glsEditCommitOutcome.NoChanges
|| row.Outcome == glsEditCommitOutcome.CommittedNeedsRefresh;
Console.WriteLine("[sample] save {0}: {1}, saved {2}", row.LayerId, row.Outcome, YesNo(saved));
placesSaved = placesSaved || (row.LayerId == Places && saved);
}
all = receipt.AllSucceeded;
}
glsEditWorkflowState state = e.Controller.WorkflowState;
Console.WriteLine("[sample] all saved: {0}, edit mode: {1}", YesNo(all), state);
return (placesSaved && all && state == glsEditWorkflowState.EditingClean)
|| Unexpected("expected places to be saved and edit mode to stay on");
}
편집 세션과 변경 집합
IGlsEditReadGate
glsBufferedEditCommitResult
glsBufferedEditWorkspace
- 생성자 (glsGDK.glsVectorDataSource)
- StageInsert(glsFeature, int[])
- StageInsert(glsFeature)
- StageUpdateAttribute(long, int, glsAttributeValue)
- StageDelete(long)
- DeleteFeature(long)
- IsPendingDelete(long)
- IsPendingInsert(long)
- TryGetPendingAttribute(long, int, out glsAttributeValue)
- GetViewId(long)
- GetViewIds(long[])
- GetSourceId(long)
- GetCommittedId(long)
- Commit()
- Cancel()
- Dispose()
- ~glsBufferedEditWorkspace()
- IsOutcomeUnknown
- IsSaving
- HasChanges
- DeletedCount
- UpdatedCount
- InsertedCount
- Revision
- ReadView
glsEditCommitOutcome
glsEditSession
- AddFeature(glsFeature)
- UpdateFeature(glsFeature)
- UpdateFeatureAttribute(long, int, glsAttributeValue)
- DeleteFeature(long)
- Commit()
- Rollback()
- Dispose()
- ~glsEditSession()
- DeletedCount
- UpdatedCount
- InsertedCount
glsEditSessionCommitResult
glsEditSessionCommittedEventArgs
glsEditSessionState
- 생성자
- IsSourceBeingEdited(glsVectorDataSource)
- TryBeginEdit(glsMapView, string)
- IsEditing(string)
- EntryKey(string)
- TryAddFeature(string, glsFeature, out long)
- TryUpdateFeatureGeometry(string, long, glsFeature)
- TryUpdateFeatureAttributes(string, long, glsFeature)
- TryUpdateFeatureAttribute(string, long, int, glsAttributeValue)
- TryDeleteFeatures(string, long[])
- ViewIdForSourceId(string, long)
- ViewIdsForSourceIds(string, long[])
- GetWorkspace(string)
- AliasCount(string)
- Rollback(string)
- ClearAliasSelections(glsMapView, string)
- EndEdit(glsMapView, string)
- DiscardEntry(glsMapView, string)
- Reset(glsMapView)
- IsCommitting(string)
- IsOutcomeUnknown(string)
- HasPendingChanges(string)
- HasAnyPendingChanges()
- InsertedCount(string)
- UpdatedCount(string)
- DeletedCount(string)
- Commit(string)
- RegisterReadGate(IGlsEditReadGate)
- UnregisterReadGate(IGlsEditReadGate)
- Dispose()
- ~glsEditSessionState()
- Committed
- StateChanged
glsEditSessionStateChangedEventArgs
레이어 편집 모드, 저장과 이력
glsEditController
- 생성자 (glsGDK.glsEditSessionState)
- SaveLayer(glsMapView, string)
- SaveAll(glsMapView)
- SaveAndFinish(glsMapView, string)
- StartEditing(glsMapView, string)
- CanStartEditing(glsMapView, string)
- BeginEditingLayer(glsMapView, string)
- SaveEdits()
- SaveAndFinishEditing(glsMapView)
- GetLastSaveRefreshWarning()
- CancelEditing(glsMapView)
- Reset(glsMapView)
- SyncWithView(glsMapView)
- IsOperationAllowed(string, glsEditOperation)
- TryReadLayerInfo(glsMapView, string, out glsEditLayerInfo)
- GetLayerStatus(glsMapView, string)
- CanInsertFeature(glsMapView, string, glsSketchGeometryKind)
- IsSpatialEditLayer(glsMapView, string)
- IsPolygonEditLayer(glsMapView, string)
- AddFeatureFromSketch(glsMapView, string, glsSketchGeometryKind, glsMapPoint[], int[], glsAttributeValue[], bool)
- AddFeatureFromWkb(glsMapView, string, byte[], int, int[], glsAttributeValue[], bool)
- UpdateFeatureAttributes(glsMapView, string, long, int[], glsAttributeValue[], bool)
- UpdateFeatureGeometry(glsMapView, string, long, byte[], int, bool)
- UpdateFeatureGeometryAndAttributes(glsMapView, string, long, byte[], int, int[], glsAttributeValue[], bool)
- DeleteFeatures(glsMapView, string, long[], bool)
- PeekUndoKind()
- PeekRedoKind()
- PeekUndoLabel()
- PeekRedoLabel()
- TryPeekUndo(out glsEditHistoryKind, out string)
- TryPeekRedo(out glsEditHistoryKind, out string)
- Undo(glsMapView)
- Redo(glsMapView)
- BeginEditGroup(glsEditHistoryKind, string)
- Dispose()
- ~glsEditController()
- HistoryLimit
- CanRedo
- CanUndo
- HasAnyOpenEditSession
- HasDirtyEdits
- WorkflowState
- LastSaveNeedsRefresh
- HistoryChanged
glsEditGroup
glsEditHistoryKind
glsEditHistoryLayerChange
glsEditHistoryStepResult
glsEditLayerInfo
glsEditLayerSaveResult
glsEditLayerStatus
glsEditOperation
glsEditSaveResult
glsEditWorkflowState
피처 복사, 삽입과 기하 편집
glsEditableGeometry
- FromWkb(byte[], bool)
- GetRingCount(int)
- GetVertexCount(int, int, bool)
- GetVertex(int, int, int)
- GetVertex3D(int, int, int)
- IsPartClosed(int)
- ToWkb()
- TransformWith(glsCoordinateTransform)
- Translate(double, double)
- MoveVertex(int, int, int, glsMapPoint)
- MoveVertex3D(int, int, int, glsMapPoint3D)
- InsertVertexAfter(int, int, int, glsMapPoint)
- InsertVertexAfter3D(int, int, int, glsMapPoint3D)
- DeleteVertex(int, int, int)
- SupportsVertexDelete(int, int, int)
- Validate()
- Dispose()
- ~glsEditableGeometry()
- PartCount
- HasZ
- BaseWkbType
glsFeatureClipboard
- 생성자
- Copy(glsMapView)
- Clear()
- Paste(glsEditController, glsMapView, string, out int)
- Dispose()
- ~glsFeatureClipboard()
- SourceLayerId
- IsEmpty
- Count
glsFeatureInsert
- KindMatchesGeometryType(glsGeometryType, glsSketchGeometryKind)
- ValidateSketchInput(glsSketchGeometryKind, glsMapPoint[])
- BuildFeatureWkb(glsGeometryType, glsSketchGeometryKind, glsMapPoint[])
- TransformMapPointsToSourceCrs(glsSpatialReference, glsSpatialReference, glsMapPoint[])
- DefaultInsertStyleJson(glsSketchGeometryKind, string)