esri arcobj 开发for java

1、查找数据

1)、利用FeaturCursor进行空间查询

//利用构造的Envelope(矩形框),查找和Envelope相交的FeatureClass的要素集

//结果数据利用循环FeatureCursor.nextFeature获得

IEnvelope envelope = new EnvelopeClass();

envelope.PutCoords(508786, 681196, 513033, 684341);

//空间查询

ISpatialFilter spatialFilter = new SpatialFilterClass();

spatialFilter.Geometry = envelope;

String shpFld = featureClass.ShapeFieldName;

spatialFilter.GeometryField = shpFld;

spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;//相交

IQueryFilter queryFilter = new QueryFilterClass();

queryFilter = (IQueryFilter)spatialFilter;

IFeatureCursor searchCursor = featureClass.Search(queryFilter, true);

IFeature feature = searchCursor.NextFeature();

int n = 0;

while (feature != null){

    n++;

    feature = baseCursor.NextFeature();

}

 

2)、利用FeatureCursor在选择集中进行查询

IFeatureSelection pFeatureSelectio = pFeatureLayer as IFeatureSelection; 

ICursor ppCursor;
pFeatureSelectio.SelectionSet.Search(null, false, out ppCursor);

IFeatureCursor pFeatureCursor = ppCursor as IFeatureCursor;  

IFeature pFeature = pFeatureCursor.NextFeature();

 

3)、利用FeatureCursor进行属性查询

IQueryFilter pQueryFilter = new QueryFilterClass();                            

pQueryFilter.WhereClause = "PROJECTCODE = '" + this.ProjectNumTextBox.Text.Trim() + "'";

IFeatureCursor pFeatureCursor = LineFeaClass.Search(pQueryFilter, false);                            

IFeature pFeatureIfExit = pFeatureCursor.NextFeature();

 

2、 插入数据

1)、利用Insert Cursors和featureBuffer

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值