ao 추가 조작
3085 단어 조작하다
//IFeatureBuffer Example
public void IFeatureBuffer_Example(IFeatureClass featureClass)
{
//Function is designed to work with polyline data
if (featureClass.ShapeType != ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline) { return; }
//get the Workspace from the IDataset interface on the feature class
IDataset dataset = (IDataset)featureClass;
IWorkspace workspace = dataset.Workspace;
//Cast for an IWorkspaceEdit
IWorkspaceEdit workspaceEdit = (IWorkspaceEdit)workspace;
//Start an edit session and operation
workspaceEdit.StartEditing(true);
workspaceEdit.StartEditOperation();
//Create the Feature Buffer
IFeatureBuffer featureBuffer = featureClass.CreateFeatureBuffer();
//Create insert Feature Cursor using buffering = true.
IFeatureCursor featureCursor = featureClass.Insert(true);
object featureOID;
//With a feature buffer you have the ability to set the attribute for a specific field to be
//the same for all features added to the buffer.
featureBuffer.set_Value(featureBuffer.Fields.FindField("InstalledBy"), "K Johnston");
//Here you can set the featurebuffers's shape by setting the featureBuffer.Shape
//to a geomerty that matched the featureclasses.
//Create 100 features using FeatureBuffer and insert into a feature cursor
ESRI.ArcGIS.Geometry.IPolyline polyline = new ESRI.ArcGIS.Geometry.PolylineClass();
ESRI.ArcGIS.Geometry.IPoint point = new ESRI.ArcGIS.Geometry.PointClass();
for (int i = 0; i < 100; i++)
{
//Create the polyline geometry to assign to the new feature
point.X = 498490 + i * 10;
point.Y = 675380 + i * 10;
polyline.FromPoint = point;
point = new ESRI.ArcGIS.Geometry.PointClass();
point.X = 498480 + i * 10;
point.Y = 675390 + i * 10;
polyline.ToPoint = point;
featureBuffer.Shape = polyline;
//Insert the feature into the feature cursor
featureOID = featureCursor.InsertFeature(featureBuffer);
}
//Flush the feature cursor to the database
//Calling flush allows you to handle any errors at a known time rather then on the cursor destruction.
featureCursor.Flush();
//Stop editing
workspaceEdit.StopEditOperation();
workspaceEdit.StopEditing(true);
//Release the Cursor
System.Runtime.InteropServices.Marshal.ReleaseComObject(featureCursor);
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
java에서 네 가지 조작 xml 방식의 비교DOM은 XML 문서의 공식 W3C 표준을 플랫폼 및 언어와 무관한 방식으로 나타냅니다.DOM은 계층 구조로 구성된 노드 또는 정보 단편의 집합입니다.이 차원 구조는 개발자가 트리에서 특정한 정보를 찾을 수 있도록 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.