面文件都有几何类型. arcengine在绘图时,不规则的多边形的几何类型是esriGeometryPolygon,矩形的几何类型是esriGeometryEnvelope,圆的几何类型是esriGeometryPolygon. 在将IGeometry转为IFeatureClass的过程中,矩形的会报错,所以想到将矩形转面.\

IGeometry geometry;//绘制好的矩形

IEnvelope envelope =  geometry as IEnvelope;
IPoint pt = new PointClass();

IPointCollection ptc = new PolygonClass();
object _missing = Type.Missing;

pt.PutCoords(envelope.XMin,envelope.YMin);
ptc.AddPoint(pt, ref _missing, ref _missing);
pt.PutCoords(envelope.XMin,envelope.YMax);
ptc.AddPoint(pt, ref _missing, ref _missing);
pt.PutCoords(envelope.XMax,envelope.YMax);
ptc.AddPoint(pt, ref _missing, ref _missing);
pt.PutCoords(envelope.XMax,envelope.YMin);
ptc.AddPoint(pt, ref _missing, ref _missing);

IPolygon polygon = new PolygonClass();
polygon = ptc as IPolygon;
 geometry = polygon as IGeometry;

参考:

https://www.bbsmax.com/A/pRdBZPY1dn/

https://www.bbsmax.com/A/q4zVM4wGdK/

arcgisengine实现矩形转面的更多相关文章

  1. [BOT] 一种android中实现“圆角矩形”的方法

    内容简介 文章介绍ImageView(方法也可以应用到其它View)圆角矩形(包括圆形)的一种实现方式,四个角可以分别指定为圆角.思路是利用"Xfermode + Path"来进行 ...

  2. C语言 · 矩形面积交

    问题描述 平面上有两个矩形,它们的边平行于直角坐标系的X轴或Y轴.对于每个矩形,我们给出它的一对相对顶点的坐标,请你编程算出两个矩形的交的面积. 输入格式 输入仅包含两行,每行描述一个矩形. 在每行中 ...

  3. canvas快速绘制圆形、三角形、矩形、多边形

    想看前面整理的canvas常用API的同学可以点下面: canvas学习之API整理笔记(一) canvas学习之API整理笔记(二) 本系列文章涉及的所有代码都将上传至:项目代码github地址,喜 ...

  4. [LeetCode] Perfect Rectangle 完美矩形

    Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover o ...

  5. [LeetCode] Rectangle Area 矩形面积

    Find the total area covered by two rectilinear rectangles in a2D plane. Each rectangle is defined by ...

  6. [LeetCode] Maximal Rectangle 最大矩形

    Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and ...

  7. [LeetCode] Largest Rectangle in Histogram 直方图中最大的矩形

    Given n non-negative integers representing the histogram's bar height where the width of each bar is ...

  8. [翻译svg教程]svg中矩形元素 rect

    svg 元素<rect> 是一个矩形元素,用这个元素,可以你可以绘制矩形,设置矩形宽高,边框的宽度颜色,矩形的填充颜色,是否用圆角等 rect 示例 <svg xmlns=" ...

  9. C# GDI绘制矩形框,鼠标左键拖动可移动矩形框,滚轮放大缩小矩形框

    最近工作需要,要做一个矩形框,并且 用鼠标左键拖动矩形框移动其位置.网上查了一些感觉他们做的挺复杂的.我自己研究一天,做了一个比较简单的,发表出来供大家参考一下.如觉得简单,可路过,谢谢.哈哈. 先大 ...

随机推荐

  1. R语言编程艺术#02#矩阵(matrix)和数组(array)

    矩阵(matrix)是一种特殊的向量,包含两个附加的属性:行数和列数.所以矩阵也是和向量一样,有模式(数据类型)的概念.(但反过来,向量却不能看作是只有一列或一行的矩阵. 数组(array)是R里更一 ...

  2. springboot 中打印 sql 语句

    在配置文件中 application.yml 配置如下其一即可 方式一: logging: level: com.xxx.com.dao.mapper: DEBUG //包路径为mapper文件包路径 ...

  3. phpmyadmin登录提示mysqli_real_connect(): (HY000/2002): No such file or directory和mysql8登录失败的问题

    网上的解决方法有很多,但都无法解决我的问题,最后在stackoverflow上找到解决方法,原文地址:https://stackoverflow.com/questions/41881123/mysq ...

  4. Java如何进行Base64的编码(Encode)与解码(Decode)?

    https://blog.csdn.net/zhou_kapenter/article/details/62890262 *************************************** ...

  5. c++类成员函数后边加const是为什么?

    时间是让人猝不及防的东西,晴是有风阴时有雨,争不过朝夕,又念着往昔,偷走了青丝却留住一个你 #include <iostream> #include <string> usin ...

  6. Go指南_切片的长度与容量

    源地址 https://tour.go-zh.org/moretypes/11 一.描述 切片拥有 长度 和 容量. 切片的长度就是它所包含的元素个数. 切片的容量是从它的第一个元素开始数,到其底层数 ...

  7. C# Winform 防止MDI子窗体重复打开

    可以在MDI主窗体中添加以下方法. //防止打开多个窗体 private bool ShowChildrenForm(string p_ChildrenFormText) { int i; //依次检 ...

  8. linux(centos7) nginx php mysql安装

    环境: linux:centos7 php:7.0 基础命令 // yum install -y lrzsz // centos7 默认已安装yum install epel-release ngin ...

  9. Android TextView文字空格

     表示全角空格, <string name="aaa">你好      啊</string> http://stackoverflow.com/questi ...

  10. 设计模式,python延迟计算缓存模式

    之前已经发过单独的缓存,这也算一种模式. from __future__ import print_function import functools class lazy_property(obje ...