arcgis for android 10.1 实现面分割、裁剪、合并

首先我们了解 arcgis for android 的开发文档

http://resources.arcgis.com/en/help/android-sdk/

1.GeometryEngine 给我提供很多方法其中有 difference 

public static Geometry difference (Geometry inputGeometry, Geometry substractor, SpatialReference spatialReference)

Creates the difference of two geometries. The resultant geometry is the part of inputGeometry not in the substractor. The dimension of substractor has to be equal to or greater than that of inputGeometry.

Parameters

inputGeometryThe geometry being subtracted.
substractorThe geometry object to subtract from.
spatialReferenceThe spatial reference of the geometries.

创建两个几何的差异。 生成的几何是inputGeometry的一部分,不在减法器中。 减法器的尺寸必须等于或大于inputGeometry的尺寸。

我们只需要获取两个 Geometry 即可实现裁剪操作。

Geometry  clipGeometry;
Geometry  inputGeometry;
Geometry geometry = GeometryEngine.difference(clipGeometry,inputGeometry, SpatialReference.create(SpatialReference.WKID_WGS84));

这样就可以得到一个新的图层。

 

2.GeometryEngine 合并 给我提供很多方法其中有 union 

public static Geometry union (Geometry[] geometries, SpatialReference spatialReference)

Constructs a new geometry by union an array of geometries. All inputs must be of the same type of geometries and share one spatial reference.

Parameters

geometriesThe geometries to union.
spatialReferenceThe spatial reference of the geometries.

Returns

  • The geometry object representing the resultant union.

通过合并一组几何图形来构造新的几何图形。 所有输入必须具有相同的几何类型,并且共享一个空间参考。

合并的方法比较简单,

Geometry[] geometrys = new Geometry[2];
geometrys[0] = uniteGeometry1;
geometrys[1] = uniteGeometry2;
Geometry geometry = GeometryEngine.union(geometrys, SpatialReference.create(SpatialReference.WKID_WGS84));

 

这样就可以生成一个新的图形。

 

如果有不懂的可以加我QQ 1051163731 (备注:优快云)

欢迎加我微信: wanbeishijie

一起交流学习或者合作开发

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值