zoukankan      html  css  js  c++  java
  • 常用代码

    图层
    1、加载地图,选择图层 
      if(!Page.IsPostBack)
       {
        MapControl1.Map.Clear();
        MapControl1.Map.Load(MapLoader.CreateFromFile(Server.MapPath("/mymap")+"\\map\\xy.gst"));
        MapControl1.SelectableLayers.Clear();
        MapControl1.SelectableLayers.Add("o地名p");
       }
    2、清空图层
    可以把图层当成一个结果集
        (_tempTable as IFeatureCollection).Clear();
    3、根据图层名获得图层
        MapInfo.Engine.Session.Current.Catalog.GetTable(TableName)

    图元
    1、遍历所有结果集
       Selection sl =MapInfo.Engine.Session.Current.Selections.DefaultSelection;
       IResultSetFeatureCollection fc=sl[0];
       IFeatureEnumerator fn=fc.GetFeatureEnumerator();
       ListBox1.Items.Clear();
       while(fn.MoveNext())
        if(fn.Current.Geometry.GetType().ToString()=="MapInfo.Geometry.LegacyText")
         ListBox1.Items.Add(((MapInfo.Geometry.LegacyText)fn.Current.Geometry).Caption);
    2、根据关键字获得(第一个)图元
        MapInfo.Engine.Session.Current.Catalog.SearchForFeature("Layer1",MapInfo.Data.SearchInfoFactory.SearchWhere("MI_Key='"+strKey+"'") )
  • 相关阅读:
    OpenCV 使用FLANN进行特征点匹配
    OpenCV 特征描述
    OpenCV 特征点检测
    OpenCV 亚像素级的角点检测
    OpenCV Shi-Tomasi角点检测子
    OpenCV Harris 角点检测子
    OpenCV 模板匹配
    OpenCV 直方图计算
    OpenCV 直方图均衡化
    OpenCV 仿射变换
  • 原文地址:https://www.cnblogs.com/jetz/p/197759.html
Copyright © 2011-2022 走看看