geometry-api-java 学习笔记(七)拓扑运算之cut

cut操作是一种布尔操作,cut操作符就是对给定的几何图形进行cut。

下图给了例子:

用java操作cut如下:

//This creates an instance of the cut operator. //创建cut操作的句柄
OperatorCut opCut = OperatorCut.local();

/*
* considerTouch: True/False indicates whether we consider a touch event a cut
* cuttee: Input Geometry to be cut (Polygon/Polyline)
* cutter: Polyline which will divide the cuttee into pieces where it crosses the cutter.
* Returns a Geometry cursor of the cut geometries.
*/
GeometryCursor cursor = opCut.execute(considerTouch, cuttee, cutter, spatialReference, null);

/*
* For retrieving the resultant Polygon(s) from the GeometryCurson we use,
*/
Polygon cut = (Polygon) cursor.next();
这里主要注意
opCut.execute(considerTouch, cuttee, cutter, spatialReference, null);
里面给定的四个参数即可,最后返回一个集合游标。

提示:这里的cut线为又向线,沿着方向切割。

All left cuts will be grouped together in the first geometry. Right cuts and coincident cuts are grouped in the second geometry. Each undefined cut along with any uncut parts are output as separate geometries. If there were no cuts, the cursor will return no geometry. If the left or right cut does not exist, the returned geometry will be empty for this type of cut.

An undefined cut will only be produced if a left or right cut was produced and there was a part left over after cutting or a cut is bounded to the left and right of the cutter.


参考:http://esri.github.io/geometry-api-java/doc/Cut.html




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值