zoukankan      html  css  js  c++  java
  • 如何实现几何要素的剪切

    如何实现几何要素的剪切

     IFeatureEdit Example

    ‘Assume pSet (ISet) and pMoveVector (ILine) already exist.
    Dim pUnknown As IUnknown, pFeatureEdit As IFeatureEdit
    Set pUnknown = pSet.Next

    Do While pUnknown Is Not Nothing
      Set pFeatureEdit = pUnknown
      pFeatureEdit.MoveSet pSet, pMoveVector
      Set pUnknown = pSet.Next
    Loop

    The following code is an example of one way you could split a selected polygon features by a polyline.

    Public Sub SplitFeatures(pSelectionSet As ISelectionSet, pPolyLine As IPolyline)

    ‘ open a feature cursor on the selected features that
    ‘ intersect the splitting geometry
    Dim pFeatCursor As IFeatureCursor
    Dim pSpatialFilter As ISpatialFilter
    Set pSpatialFilter = New SpatialFilter
    Set pSpatialFilter.Geometry = pPolyLine
    pSelectionSet.Search pSpatialFilter, True, pFeatCursor

    ‘ Clean up the splitting geometry
    ‘ This is necessary because, for polygons, IFeatureEdit::Split
    ‘ relies internally on ITopologicalOperator::Cut
    Dim pTopoOpo As ITopologicalOperator
    Set pTopoOpo = pPolyLine
    pTopoOpo.Simplify

    ‘ Loop through the features and split them
    Dim pFeature As IFeature
    Set pFeature = pFeatCursor.NextFeature

    Do Until pFeature Is Nothing
      Dim pFeatureEdit As IFeatureEdit
      Set pFeatureEdit = pFeature
      pFeatureEdit.Split pPolyLine
      Set pFeature = pFeatCursor.NextFeature
    Loop

    End Sub

  • 相关阅读:
    二项分布和多项分布
    TF-IDF学习笔记(二)
    TF-IDF学习笔记(一)
    jieba中文分词
    爬虫利器3:Xpath语法与lxml库
    Python爬虫利器1:Requests库的用法
    Python爬虫实战一之爬取糗事百科段子
    Python中的逻辑运算符
    Python:闭包函数与装饰器
    Python:函数名称空间与作用域:
  • 原文地址:https://www.cnblogs.com/lauer0246/p/1287393.html
Copyright © 2011-2022 走看看