ArcGISEngine编辑-IWorkspaceEdit-创新互联
IWorkspaceFactory pWsF = new ShapefileWorkspaceFactory();
让客户满意是我们工作的目标,不断超越客户的期望值来自于我们对这个行业的热爱。我们立志把好的技术通过有效、简单的方式提供给客户,将通过不懈努力成为客户在信息化领域值得信任、有价值的长期合作伙伴,公司提供的服务项目有:域名注册、雅安服务器托管、营销软件、网站建设、渭南网站维护、网站推广。IFeatureWorkspace pFtWs = pWsF.OpenFromFile(@"E:\arcgis\Engine\数据", 0) as IFeatureWorkspace;
IFeatureClass pFtClass = pFtWs.OpenFeatureClass("edit");
IFeatureLayer pFt = new FeatureLayerClass();
pFt.FeatureClass = pFtClass;
pFt.Name = "画线";
axMapControl1.Map.AddLayer(pFt as ILayer);
axMapControl1.Refresh();
//为了进一步说明Idataset,我特意从下面的代码
IDataset pDataset = pFtClass as IDataset;
IWorkspace pWs = pDataset.Workspace;
pWsEdit = pWs as IWorkspaceEdit;
pWsEdit.StartEditing(true);
pWsEdit.StartEditOperation();
pBoolStart = pWsEdit.IsBeingEdited();
System.Diagnostics.Stopwatch TimeWatch = new System.Diagnostics.Stopwatch();
TimeWatch.Start();
IFeatureBuffer pFeatureBuffer = pFtClass.CreateFeatureBuffer();
IFeatureCursor pFtCusor = pFtClass.Insert(true);
ESRI.ArcGIS.Geometry.IPolyline polyline = new ESRI.ArcGIS.Geometry.PolylineClass();
ESRI.ArcGIS.Geometry.IPoint pPoint = new ESRI.ArcGIS.Geometry.PointClass();
ESRI.ArcGIS.Geometry.IPoint pPoint2 = new ESRI.ArcGIS.Geometry.PointClass();
for (int i = 0; i < 1000; i++)
{
pPoint.X = 48 + i * 102;
pPoint.Y = 65 + i * 10;
polyline.FromPoint = pPoint;
pPoint2.X = 480 + i * 10;
pPoint2.Y = 615 + i * 102;
polyline.ToPoint = pPoint2;
pFeatureBuffer.Shape = polyline;
pFeatureBuffer.set_Value(2, i);
object pFeatureOID = pFtCusor.InsertFeature(pFeatureBuffer);
}
pFtCusor.Flush();
pWsEdit.StopEditing(true);
axMapControl1.Refresh();
TimeWatch.Stop();
MessageBox.Show(TimeWatch.Elapsed.Milliseconds.ToString());
创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。
文章标题:ArcGISEngine编辑-IWorkspaceEdit-创新互联
URL链接:http://ybzwz.com/article/ddgsjd.html