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
總結
以上是生活随笔為你收集整理的geometry-api-java 学习笔记(七)拓扑运算之cut的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Google WideDeep Mode
- 下一篇: Scala中的延迟初始化(Lazy va