点线面缓冲分析

//缓冲分析主要是生产缓冲图形,再用缓冲图形执行空间查询。

//把需要缓冲的对象放在sesssion中,这样可以对同一个缓冲对象执行多个条件的缓冲分析

ESRI.ArcGIS.ADF.Web.Geometry.Geometry geo = (ESRI.ArcGIS.ADF.Web.Geometry.Geometry)(map1.Page.Session["BufferAnalyesGeometry"]);

double dis;

if (!Double.TryParse(eventArg,out dis))

{

dis = 0.0;

}

//获取mxd配置文件中的图层属性信息

ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality qfunc =

(ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapFunctionality)map1.GetFunctionality("地图名");

//获取对象缓冲图形

if (qfunc.Resource is ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)

{

ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal ags_mr = (ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.MapResourceLocal)qfunc.Resource;

ESRI.ArcGIS.Server.IServerContext sc = ags_mr.ServerContextInfo.ServerContext;

ESRI.ArcGIS.ADF.ArcGISServer.MapDescription mapdescription;

mapdescription = qfunc.MapDescription;

//定义Com对象的点

ESRI.ArcGIS.Geometry.IGeometry igeo=null;

//点缓冲自定义方法,线、面缓冲用AO控件方法

ESRI.ArcGIS.ADF.Web.Geometry.Polygon nplygon;

if (geo is ESRI.ArcGIS.ADF.Web.Geometry.Point)

{

//生成点的缓冲图形

ESRI.ArcGIS.ADF.Web.Geometry.Point cp=(ESRI.ArcGIS.ADF.Web.Geometry.Point)geo;

common.Utils uts = new common.Utils();

ESRI.ArcGIS.ADF.Web.Geometry.PointCollection pc = uts.getMapPointBuffer(cp.X, cp.Y,dis, 1);

ESRI.ArcGIS.ADF.Web.Geometry.Ring r1= new ESRI.ArcGIS.ADF.Web.Geometry.Ring();

r1.Points = pc;

ESRI.ArcGIS.ADF.Web.Geometry.RingCollection rc = new ESRI.ArcGIS.ADF.Web.Geometry.RingCollection();

rc.Add(r1);

nplygon = new ESRI.ArcGIS.ADF.Web.Geometry.Polygon();

nplygon.Rings = rc;

}

else

{

if (geo is ESRI.ArcGIS.ADF.Web.Geometry.Polyline)

{

//线转换

ESRI.ArcGIS.ADF.Web.Geometry.Polyline pl = (ESRI.ArcGIS.ADF.Web.Geometry.Polyline)geo;

ESRI.ArcGIS.Geometry.IPointCollection com_polyline_pointcollection =

(ESRI.ArcGIS.Geometry.IPointCollection)sc.CreateObject("esriGeometry.Polyline");

object Missing = Type.Missing;

foreach (ESRI.ArcGIS.ADF.Web.Geometry.Path new_adf_path in pl.Paths)

{

ESRI.ArcGIS.Geometry.IPointCollection com_pointcollection = (ESRI.ArcGIS.Geometry.IPointCollection)sc.CreateObject("esriGeometry.Path");

foreach (ESRI.ArcGIS.ADF.Web.Geometry.Point new_adf_point in new_adf_path.Points)

{

ESRI.ArcGIS.Geometry.IPoint com_point = (ESRI.ArcGIS.Geometry.IPoint)

ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToIGeometry(new_adf_point, sc);

com_pointcollection.AddPoint(com_point, ref Missing, ref Missing);

}

com_polyline_pointcollection.AddPointCollection(com_pointcollection);

}

ESRI.ArcGIS.Geometry.IPolyline projpoly = (ESRI.ArcGIS.Geometry.IPolyline)com_polyline_pointcollection;

igeo = projpoly;

}

else

{

igeo = (ESRI.ArcGIS.Geometry.IGeometry)ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToIGeometry(geo, sc);

}

//利用AO中缓冲区分析

ESRI.ArcGIS.Geometry.ITopologicalOperator topop = (ESRI.ArcGIS.Geometry.ITopologicalOperator)igeo;

ESRI.ArcGIS.Geometry.IPolygon bufferPolygon;

bufferPolygon = (ESRI.ArcGIS.Geometry.IPolygon)topop.Buffer(dis);

//

// 定义valueobject的点

ESRI.ArcGIS.ADF.ArcGISServer.PolygonN buffer_polyn;

// 进行comobject到valueobject之间的转换

buffer_polyn = (ESRI.ArcGIS.ADF.ArcGISServer.PolygonN)

ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ComObjectToValueObject

(bufferPolygon, sc, typeof(ESRI.ArcGIS.ADF.ArcGISServer.PolygonN));

nplygon = (ESRI.ArcGIS.ADF.Web.Geometry.Polygon)ESRI.ArcGIS.ADF.Web.DataSources.ArcGISServer.Converter.ToAdfPolygon(buffer_polyn);

}

//在Buffer图层中显示结果

ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality mapFunct = (ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapFunctionality)map1.GetFunctionality(mapBufferName);

ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource gResource = (ESRI.ArcGIS.ADF.Web.DataSources.Graphics.MapResource)mapFunct.Resource;

gResource.Graphics.Tables.Clear();

ESRI.ArcGIS.ADF.Web.Display.Graphics.ElementGraphicsLayer glayer = new ESRI.ArcGIS.ADF.Web.Display.Graphics.ElementGraphicsLayer();

gResource.Graphics.Tables.Add(glayer);

ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicElement ge1 = new ESRI.ArcGIS.ADF.Web.Display.Graphics.GraphicElement(nplygon,System.Drawing.Color.SeaGreen);

ge1.Symbol.Transparency = 70.0;

glayer.Add(ge1);

//刷新地图

map1.RefreshResource(gResource.Name);

string[] lids = m_queryString["Layers"].Split(",".ToCharArray());

//执行空间查询

。。。。

。。。

转载于:https://www.cnblogs.com/weihongli/archive/2011/08/10/2133358.html

点线面缓冲分析(转自esri中国社区)相关推荐

  1. 2022-2028年中国社区体育产业深度调研及投资前景预测报告

    [报告类型]产业研究 [出版时间]即时更新(交付时间约3个工作日) [发布机构]智研瞻产业研究院 [报告格式]PDF版 本报告介绍了社区体育行业相关概述.中国社区体育行业运行环境.分析了中国社区体育行 ...

  2. redis源代码分析 – event library - Dicky - 开源中国社区

    redis源代码分析 – event library - Dicky - 开源中国社区 redis源代码分析 – event library

  3. 2018年Spring Cloud中国社区技术沙龙-成都站

    Spring Cloud中国社区(http://springcloud.cn) 是国内基于Spring Cloud微服务体系创建的非盈利技术社区,发展至今刚好两周岁.自2016年10月份创建以来,在北 ...

  4. python中国社区-Python中文社区名称的统一

    Github 好象没有投票功能哪,,, 不过,既然提起了, 俺也就抄发送一下, PyCon2013China 之后相关组委的深入讨论: 背景 俺就几个基本问题尝试厘清一下: CPyUG 的发展历史,俺 ...

  5. 2017年第十五届Esri中国用户大会资料分享

    原文地址:2017年第十五届Esri中国用户大会资料分享 2017年10月24-25日,在北京国际会议中心举办了第十五届Esri中国用户大会,今年用户大会的主题是:Applying the Scien ...

  6. 【独家对话】Esri中国副总裁蔡晓兵专访 :移动信息化是延伸更是创新

    随着移动互联网的发展,智能化.数字化将会以更加直观和简洁的方式呈现在我们面前. 空间位置信息应用的不断发展,使得一些企业以及政府相关职能部门的生产和办公效率得到了极大的提升.而且随着GPS终端设备的发 ...

  7. 知乎、B站为何成「中国社区」概念股?

    [深几度·重审互联网系列] 撰稿|吴俊宇 审阅|翟鑫源 「摘要:社区氛围带来的自传播效应,还可以帮助企业降低营销费用,让企业摆脱"买量营销"的逻辑,形成平台内容消费的良性循环.在互 ...

  8. Dapr中国社区活动之 分布式运行时开发者日 (2022.09.03)

    自2019年10月首次发布以来,Dapr(Distributed Application Runtime,分布式应用运行时)因其"更稳定"."更可靠".&quo ...

  9. 直播回顾|携手 Opentelemetry 中国社区,走进可观测性

    服务开发架构随着业务发展的要求,从传统的单体架构逐步转向分布式架构,容器.容器编排.微服务等云原生技术的应用越来越广泛.服务粒度的加剧细化,服务数量的日益增多,不可避免造成系统的复杂程度越来越高,系统 ...

  10. 开源中国社区----我的学习之旅

    开源中国社区----我的学习之旅 1.socket实现银行排队系统 http://www.oschina.net/code/snippet_2376204_53196 2.Qt棋盘 http://ww ...

最新文章

  1. 【冷门实用小工具】JAVA和C#轻量级的UML图绘制工具NClass,UML类图编辑器免安装版【亲测有效】
  2. sound.js # pixi辅助插件 — 中文翻译教程
  3. blockquote 引用的分析
  4. CentOS6在使用yum install 时提示镜像源路径不存在:PYCURL ERROR 22 - “The requested URL returned error: 404 Not Found
  5. GDI+绘制极坐标图(Polar Diagram)
  6. Docker运行GUI软件的方法
  7. 关于明晚即将发布的新款 iPad Pro,最大的亮点也许不是 Face ID
  8. 芯片人才平均薪资近万元 2020年芯片人才缺口超30万
  9. 传统云纹祥云素材,稳妥传承中国味!
  10. python的作用域 gbel_[ python ] 全局和局部作用域变量的引用
  11. Postgres用returning实现mysql的last_insert_id
  12. java面试题 Object类的常见方法总结
  13. unity编辑器扩展_07(创建对话框,检测按钮的点击,点击按钮后提示信息,保存设置的数据,显示点击按钮后的处理的进度条信息)...
  14. 互联网做手机 伤国际品牌 救国内品牌
  15. 神舟IV号开发板-带屏例程源码修改bug(2.8寸屏)
  16. 组合数学 —— 母函数
  17. 蜻蜓FM回应恶意代码事件 音频行业仍将现721格局
  18. python主题更改_jupyter notebook更换皮肤主题的实现
  19. 计算机f8键的功能,f8键有什么作用(图文)
  20. Hello Redis,我有7个问题想请教你!

热门文章

  1. ADMM算法理论与应用
  2. 百度地图API地理位置和坐标转换 城市坐标
  3. 从Gaussian 09的Hartree-Fock计算的fchk文件转换到Columbus的mocoef文件的脚本
  4. 中美两本有影响力数理统计学教材的对比及其启示(龚凤乾)
  5. python-snap7的安装记录
  6. 串口485接法图_rs485 与485通讯 接线方法?
  7. 上课解除教师机控制(红蜘蛛)超详细
  8. Nvidia控制面板选择默认独显后黑屏的解决方法
  9. idea调整代码字体大小方法
  10. VSCode开发react-native app进行android apk打包