日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

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

發(fā)布時間:2023/12/10 编程问答 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 点线面缓冲分析(转自esri中国社区) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

點(diǎn)線面緩沖分析

//緩沖分析主要是生產(chǎn)緩沖圖形,再用緩沖圖形執(zhí)行空間查詢。

//把需要緩沖的對象放在sesssion中,這樣可以對同一個緩沖對象執(zhí)行多個條件的緩沖分析

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對象的點(diǎn)

? ?? ?? ?? ?? ?? ?? ?? ?? ? ESRI.ArcGIS.Geometry.IGeometry igeo=null;

? ?? ?? ?? ?? ?? ?? ?? ?? ? //點(diǎn)緩沖自定義方法,線、面緩沖用AO控件方法

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

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

? ?? ?? ?? ?? ?? ?? ?? ?? ? {

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???//生成點(diǎn)的緩沖圖形

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???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)

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???{

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?//線轉(zhuǎn)換

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?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中緩沖區(qū)分析

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

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???ESRI.ArcGIS.Geometry.IPolygon bufferPolygon;

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

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???//

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???// 定義valueobject的點(diǎn)

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???ESRI.ArcGIS.ADF.ArcGISServer.PolygonN buffer_polyn;

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???// 進(jìn)行comobject到valueobject之間的轉(zhuǎn)換

? ?? ?? ?? ?? ?? ?? ?? ?? ?? ???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圖層中顯示結(jié)果

? ?? ?? ?? ?? ?? ?? ?? ?? ? 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());

? ?? ?? ?? ?? ?? ?? ?? ?? ? //執(zhí)行空間查詢

? ?? ?? ?? ?? ?? ?? ?? ?? ? 。。。。

。。。

轉(zhuǎn)載于:https://www.cnblogs.com/weihongli/archive/2011/08/10/2133358.html

總結(jié)

以上是生活随笔為你收集整理的点线面缓冲分析(转自esri中国社区)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。