private void createPolygons() {

    // create input polygon 1
PointCollection pointsPoly = new PointCollection(SpatialReferences.getWebMercator());
pointsPoly.add(new Point(-13160, 6710100));
pointsPoly.add(new Point(-13300, 6710500));
pointsPoly.add(new Point(-13760, 6710730));
pointsPoly.add(new Point(-14660, 6710000));
pointsPoly.add(new Point(-13960, 6709400));
inputPolygon1 = new Polygon(pointsPoly); // create and add a blue graphic to show input polygon 1
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0x990000CC, lineSymbol);
inputGeometryOverlay.getGraphics().add(new Graphic(inputPolygon1, fillSymbol)); // create input polygon 2 with a green (0xFF009900) symbol
// outer ring
PointCollection outerRingSegmentCollection = new PointCollection(SpatialReferences.getWebMercator());
outerRingSegmentCollection.add(new Point(-13060, 6711030));
outerRingSegmentCollection.add(new Point(-12160, 6710730));
outerRingSegmentCollection.add(new Point(-13160, 6709700));
outerRingSegmentCollection.add(new Point(-14560, 6710730));
outerRingSegmentCollection.add(new Point(-13060, 6711030));
Part outerRing = new Part(outerRingSegmentCollection); // inner ring
PointCollection innerRingSegmentCollection = new PointCollection(SpatialReferences.getWebMercator());
innerRingSegmentCollection.add(new Point(-13060, 6710910));
innerRingSegmentCollection.add(new Point(-12450, 6710660));
innerRingSegmentCollection.add(new Point(-13160, 6709900));
innerRingSegmentCollection.add(new Point(-14160, 6710630));
innerRingSegmentCollection.add(new Point(-13060, 6710910));
Part innerRing = new Part(innerRingSegmentCollection); // add both parts (rings) to a part collection and create a geometry from it
PartCollection polygonParts = new PartCollection(outerRing);
polygonParts.add(innerRing);
inputPolygon2 = new Polygon(polygonParts); // create and add a green graphic to show input polygon 2
fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, 0x99009900, lineSymbol);
inputGeometryOverlay.getGraphics().add(new Graphic(inputPolygon2, fillSymbol));
}

andriod arcgis createPolygons创建带空的面的更多相关文章

  1. SQL语句(二)创建带主键和约束的数据表

    内容摘要 创建带主键和约束的表 创建带组合主键和外键的表 1. 创建带主键和约束的表 Student (学生表) CREATE TABLE Student ( sclass ) NOT NULL, - ...

  2. php 中如何创建一个空对象

    // 创建一个空对象 $obj=(object)array(); //假设这是从数据库取内容 $arr=["prod_id"=>103,"prod_name&quo ...

  3. PHP中怎样创建一个空对象?

    如果没有声明一个对象然后就对其属性赋值会出现警告.那么我们给它创建一个空对象然后赋值就好了.PHP中创建一个空对象代码如下: 第一种方式: $empty_object = new stdClass() ...

  4. M1: 创建UWP空项目

    本小节介绍如何在Visual Studio中创建一个UWP项目,Visual Studio中提供了快速创建各种项目的类型模板.在Visual Studio 2015中,同样提供了UWP项目模板. 学完 ...

  5. 写入数据到Plist文件中时,第一次要创建一个空的数组,否则写入文件失败

    #pragma mark - 保存数据到本地Plist文件中 - (void)saveValidateCountWithDate:(NSString *)date count:(NSString *) ...

  6. [转] arcgis Engine创建shp图层

    小生 原文 arcgis Engine创建shp图层 以创建点图层为例.首先要得到保存文件的地址. SaveFileDialog saveFileDialog = new SaveFileDialog ...

  7. (译)iPhone: 用公开API创建带小数点的数字键盘 (OS 3.0, OS 4.0)

    (译)iPhone: 用公开API创建带小数点的数字键盘 (OS 3.0, OS 4.0) 更新:ios4.1现在已经将这个做到SDK了.你可以设置键盘类型为UIKeyboardTypeDecimal ...

  8. 【Android Developers Training】 94. 创建一个空内容提供器(Content Provider)

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

  9. 【Android Developers Training】 93. 创建一个空验证器

    注:本文翻译自Google官方的Android Developers Training文档,译者技术一般,由于喜爱安卓而产生了翻译的念头,纯属个人兴趣爱好. 原文链接:http://developer ...

随机推荐

  1. python 库资源大全

    偶然的机会翻到这篇文章,很全面,来源:  Python 资源大全中文版       哪些 Python 库让你相见恨晚? 环境管理 管理 Python 版本和环境的工具 p:非常简单的交互式 pyth ...

  2. 基于Thinkphp3.2的qq第三方oauth认证登录扩展类

    基于Thinkphp3.2的qq第三方oauth认证登录扩展类,由于腾讯oauth sdk写的太多,不能与thinkphp和好的结合,最终想法讲腾讯oauth sdk写成tp的扩展类先看代码,将代码保 ...

  3. servlet文件下载实例剖析

    package mypack; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; ...

  4. JAVA基础知识之jdk下载与安装

    一.下载JDK 下载网址:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 如果 ...

  5. poj-1151矩形面积并-线段树

    title: poj-1151矩形面积并-线段树 date: 2018-10-30 22:35:11 tags: acm 刷题 categoties: ACM-线段树 概述 线段树问题里的另一个问题, ...

  6. ubuntu下安装和破解navicat的方法

    ubuntu下安装和破解navicat的方法 之前我也在苦苦搜寻ubuntu完美破解navicat的方法,但是大家都说是删除掉~/.Navicat,就可以续用,的确是这样,但是很麻烦. 于是我找到了一 ...

  7. Bzoj4710 分特产(容斥原理+组合数)

    题面 Bzoj 题解 考虑容斥原理,所有人都有特产的方案数等于: 至少零个人没有特产\(-\)至少一个人没有特产\(+\)至少两个人有特产\(-...\) 接着考虑其中一种情况怎么求(假设现在至少有\ ...

  8. matlab绘制心形函数

    matlab 7.0 绘制二维.三维心形函数       又到周六,下周就要迎来春节小长假了,想想都有些激动.在外漂了一整年,总于可以回家和父母团聚了,还有吃好吃的...,哎呀~想想都流口水呢.不过先 ...

  9. Revit二次开发示例:CancelSave

    在Revit程序中注册文件操作事件,保存新建或打开文件的信息.当保存时,如果当前文件内容和之前的一致时,则弹出对话框提示并取消保存.对话框中有一个功能链接,点击可打开插件所在目录. #region N ...

  10. Python复数属性和方法操作实例

    转自: https://blog.csdn.net/henni_719/article/details/56665254 #coding=utf8 ''' 复数是由一个实数和一个虚数组合构成,表示为: ...