arcgis添加要素类代码
Codegino
Sub addPoint()
Dim pMxDoc As IMxDocument
Dim pMap As IMap
Dim pFeatureLayer As IFeatureLayer
Dim pFeatureClass As IFeatureClass
Dim p As IPoint
Dim pFeature As IFeature
Set pMxDoc = ThisDocument
英语小说
Set pMap = pMxDoc.FocusMap
Set pFeatureLayer = pMap.Layer(0)
Set pFeatureClass = pFeatureLayer.FeatureClass
Set pFeature = pFeatureClass.CreateFeature
'添加点的坐标
Set p = New point
p.X = 76374.006
p.Y = -3660.849
中文在线翻译成英文
2020年12月六级答案产生英文Set pFeature.Shape = p
pFeature.Value(2) = "111"
pFeature.Value(3) = "测试添加"
pFeature.Store
End Sub
今天开发arcgis rver的时候使⽤代码动态添加要素,发现出错,结果想⽤vba试试。结果VBA⼀试就成功了。java 添加代码。
Code
int minx = Integer.("Map0_minx").toString());
int miny = Integer.("Map0_miny").toString());上半年英文
WebPoint tmpExtent = new WebPoint();
tmpExtent.tX(minx);
tmpExtent.tY(miny);
tmpExtent = (WebPoint) MapGeometry(wm);
AGSLocalMapResource mapResource = (AGSLocalMapResource) context
.getResources().get("ags0");
IFeatureLayer featurelayer = getFeatureLayer(mapResource);
IServerContext rverContext = ServerContext();
IPoint webPoint = (IPoint) Clsid());
webPoint.X());
webPoint.Y());
if (featurelayer != null) {
IFeatureClass FeatureClass();
System.out.println("aliasName:" +AliasName());
IDatat ds=new IDatatProxy(featureCls);
osa
IWorkspace ws=new Workspace());
IWorkspaceEdit w=new IWorkspaceEditProxy(ws);
//IWorkspaceEdit w=(IWorkspaceEdit)ws;
//w.startEditing(fal);
w.startEditOperation();
IFeature feature =ateFeature();
feature.tShapeByRef((IGeometry) webPoint);
学英语软件
feature.tValue(2, "123456");
趣味数学故事feature.tValue(3, "测试添加");
i dream a dreamfeature.store();
w.stopEditOperation();
//w.stopEditing(true);
}
java 下出错于下:
AutomationException: 0x80004005 - Unspecified error
at com.esri.arcgis.interop.Dispatch.vtblInvoke(Unknown Source)
at com.ateFeature(Unknown Source)最后发现没有问题,后⾯我打了arcgis rver sp 6. 问题解决了。原来是补丁的问题。