zoukankan      html  css  js  c++  java
  • 判断多边形是否为环或者是眼睛的方法

    Private Sub UIButtonControl2_Click()

    Dim app As IApplication
    Set app = Application

    Dim pMxDocument As IMxDocument
    Set pMxDocument = Application.Document

    Dim pMap As IMap
    Set pMap = pMxDocument.FocusMap

    Dim pFeatureLayer As IFeatureLayer
    Set pFeatureLayer = pMap.Layer(0)

    Dim pFeatureCursor As IFeatureCursor
    Set pFeatureCursor = pFeatureLayer.FeatureClass.Search(Nothing, False)

    Dim pFeature As IFeature
    Set pFeature = pFeatureCursor.NextFeature

    Dim pPolygon As IPolygon
    Dim geocollection As IGeometryCollection
    Dim pRing As IRing
    Dim inringcount As Integer

    While Not pFeature Is Nothing
    Set pPolygon = pFeature.Shape
    Set geocollection = pPolygon

      If geocollection.GeometryCount > 1 Then
      inringcount = inringcount + 1
      pMap.SelectFeature pFeatureLayer, pFeature
      End If

     ' If pPolygon.ExteriorRingCount > 1 Then
      'pMap.SelectFeature pFeatureLayer, pFeature
     ' End If
     
     ' If pPolygon.ExteriorRingCount = 1 Then
     ' Set pPointCollection = pPolygon
     ' Set pRing = pPointCollection
     ' inringcount = pPolygon.InteriorRingCount(pRing)
     ' If inringcount > 0 Then
     ' pMap.SelectFeature pFeatureLayer, pFeature
     ' End If
     ' End If

    Set pFeature = pFeatureCursor.NextFeature
    Wend

    Dim pActiveview As iactiveview
    Set pActiveview = pMap
    pActiveview.Refresh
    MsgBox "一共有" & inringcount & "个不规则多边形"

    End Sub
  • 相关阅读:
    git
    centos7安装python3和ipython
    centos7 安装mysql5.7
    ceph-文件存储
    ceph-对象存储
    ceph-块存储客户端
    ceph-简介及安装(luminous)版
    centos7 kvm安装使用
    webpack多页面应用打包问题-新增页面打包JS影响旧有JS资源
    webpack4.0 babel配置遇到的问题
  • 原文地址:https://www.cnblogs.com/zhangjun1130/p/1629166.html
Copyright © 2011-2022 走看看