• 大小: 27.55MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-16
  • 语言: 其他
  • 标签: iObject  .NET  SuperMap  GIS  

资源简介

在进行数据分析时,通常需要通过缓冲区进行查询。本范例示范如何通过创建缓冲区对数据进行查询。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SuperMap.Data;
using SuperMap.Mapping;
using SuperMap.UI;
using SuperMap.Analyst.SpatialAnalyst;
using System.Drawing;
using System.Windows.Forms;

namespace BufferQuery
{
   public class Buffer
    {
        private Workspace m_workspace;
        private MapControl m_mapControl;
        public GeoRegion bufferRegion;
        private Trackinglayer trackinglayer;
        private Point2D mpoint;
        private Recordset mRecordset;
        private layer layer;
        private Point2Ds point2Ds; 
       public Buffer(Workspace workspace MapControl mapControl)
       {
           m_workspace = workspace;
           m_mapControl = mapControl;
           trackinglayer = m_mapControl.Map.Trackinglayer;
           point2Ds = new Point2Ds();
       }
       /// 
       /// 创建缓冲区
       /// 

       /// 
       public void CreateRegion()
       {
           GeoCircle Circle = new GeoCircle(point2Ds[0]point2Ds[1]);
           Geostyle style = new Geostyle();
           style.MarkerSize = new Size2D(4 4);
           style.FillOpaqueRate = 50;
           style.FillSymbolID = 36;
           style.LineWidth = 0.5;
           style.FillForeColor = Color.AliceBlue;
           style.LineColor = Color.Blue;
           bufferRegion = Circle.ConvertToRegion(50);
           bufferRegion.style = style;
           int lineIndex = trackinglayer.IndexOf(“region“);
           if (lineIndex != -1)
           {
               trackinglayer.Remove(lineIndex);
           }
           trackinglayer.Add(bufferRegion “region“);
           m_mapControl.Action = SuperMap.UI.Action.Pan;
           m_mapControl.Map.Refresh();
       }
       /// 
       /// 清除直径端点
       /// 

       public void point_Clear()
       {
           point2Ds.Clear();
       }
       /// 
       /// 范围查询
       /// 

       /// 
       public void RangeQuery()
       {

           CreateRegion();
            layer = GetlayerByCaption(“School@Changchun“);
           QueryParameter mQueryParameter = new QueryParameter();
           mQueryParameter.SpatialQueryobject = bufferRegion;
           mQueryParameter.SpatialQueryMode = SpatialQueryMode.Contain;
           mQueryParameter.HasGeometry = true;
           mQueryParameter.CursorType = CursorType.Static;
           DatasetVector mDatasetVector = layer.Dataset as DatasetVector;
           mRecordset = mDatasetVector.Query(mQueryParameter);
           layer.Selection.FromRecordset(mRecordset);
           m_mapControl.Map.EnsureVisible(bufferRegion);
           layer.Selection.style.LineColor = Color.Red;
       }
       /// 
       /// 返回查询图层
       /// 

       /// yerCaption“>
       /// 
       private La

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      17920  2016-12-30 10:12  BufferQuery\BufferQuery\bin\Debug\BufferQuery.exe

     文件      32256  2016-12-30 10:12  BufferQuery\BufferQuery\bin\Debug\BufferQuery.pdb

     文件      22984  2017-01-04 09:54  BufferQuery\BufferQuery\bin\Debug\BufferQuery.vshost.exe

     文件        490  2015-11-13 10:24  BufferQuery\BufferQuery\bin\Debug\BufferQuery.vshost.exe.manifest

     文件    1765888  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Analyst.SpatialAnalyst.dll

     文件     394091  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Analyst.SpatialAnalyst.xml

     文件     263168  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Analyst.SpatialStatistics.dll

     文件      33751  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Analyst.SpatialStatistics.xml

     文件    1378816  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Chart.dll

     文件     131190  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Chart.xml

     文件    1091072  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Data.Conversion.dll

     文件     359563  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Data.Conversion.xml

     文件   11817984  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Data.dll

     文件    1668933  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Data.xml

     文件    4305920  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Layout.dll

     文件     107482  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Layout.xml

     文件    5787648  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Mapping.dll

     文件     502149  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Mapping.xml

     文件    8438784  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.Realspace.dll

     文件     399405  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.Realspace.xml

     文件    4397056  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\SuperMap.UI.Controls.dll

     文件     106770  2016-09-27 08:31  BufferQuery\BufferQuery\bin\Debug\SuperMap.UI.Controls.xml

     文件     174592  2016-09-27 08:28  BufferQuery\BufferQuery\bin\Debug\zh-CN\SuperMap.Data.resources.dll

     文件       4942  2016-12-30 10:12  BufferQuery\BufferQuery\Buffer.cs

     文件       4482  2016-12-28 17:16  BufferQuery\BufferQuery\BufferQuery.csproj

     文件       4338  2016-12-30 10:12  BufferQuery\BufferQuery\Form1.cs

     文件       5623  2016-12-30 09:54  BufferQuery\BufferQuery\Form1.Designer.cs

     文件      10630  2016-12-30 09:54  BufferQuery\BufferQuery\Form1.resx

     文件       3622  2016-12-30 09:54  BufferQuery\BufferQuery\obj\Debug\BufferQuery.BufferQuery.resources

     文件       1887  2017-01-04 09:54  BufferQuery\BufferQuery\obj\Debug\BufferQuery.csproj.FileListAbsolute.txt

............此处省略32个文件信息

评论

共有 条评论