惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 胡敏

WebSharp 3.0(个人修订版)全代码,WebSharp 的作者已经抛弃它了吗?(一个国产ORM框架) 从追MM谈Java的23种设计模式 - 太经典了,转到自己的BLOG上收藏着先 利用.net创建安全COM控件 AutoCAD二次开发之创建菜单 我的家——三维地图 一个数独问题的算法(已更新,提供一个简单算法,欢迎拍砖) 生活在垃圾网络中,我们该怎么办? vs.net 2005 中文版下载 c#调用des64.dll进行加密解密 - 胡敏 - 博客园 MapXtreme 2004 6.2 中文版破解文件及安装方法(已经不提供下载) 提供MapXtreme 2004 6.2 NCP破解文件及安装方法(已经不能提供了,等待破解最新的吧) 爆笑经典签名 一句话经典笑话 MapXtreme2004初学者资料(整理) 移动用户查询手机开通的服务 使用 Rational XDE for .net建模和设计数据库(原创) 自己动手注册xde for .net帮助 如何得到别人收藏夹里的网址 十种你不知道的东西,绝对经典(如果你知道就不用点了,该休息了)(转)
MapXtreme2004新手资料续
胡敏 · 2005-10-27 · via 博客园 - 胡敏

1.从ORACLE表中加载图层的问题。。。
MIConnection Connection=new MIConnection();
Connection.Open();
TableInfoServer tis1=new TableInfoServer("WORLD",
   "SRVR=ora8i;UID=wzz;PWD=11111111",
   "select * from world",MapInfo.Data.ServerToolkit.Oci);
MapInfo.Data.Table [] tables=new MapInfo.Data.Table[2];
tables[0]=Connection.Catalog.OpenTable(tis1);
  TableInfoServer tis2=new TableInfoServer("WORLDCAP",
  "SRVR=ora8i;UID=wzz;PWD=11111111",
  "select * from worldcap",MapInfo.Data.ServerToolkit.Oci);
tables[1]=Connection.Catalog.OpenTable(tis2);
MapControl1.Map.Load(new MapInfo.Mapping.MapTableLoader(tables));

2.存在SqlSever中XY坐标点的绑定代码
//XY绑定:含有x,y坐标点的图层放置在Sql Server数据库中,按xy坐标生成点图层
//1.要在存在该表的数据库中建立MAPINFO_MAPCATALOG表,否则会报错:
//"An unhandled exception of type 'MapInfo.Data.TableException' occurred in mapinfo.coreengine.dll.
//Additional information: 不能打开表。 ODBC 错误: ODBC RC=-1, ODBC SQLState=S0002, DBMS RC=208, DBMS Msg=[Microsoft][ODBC SQL Server Driver][SQL Server]对象名 'MAPINFO.MAPINFO_MAPCATALOG' 无效。
//2.要含xy坐标点的表建立主键,否则会报错:
//"Additional information: 不能打开表。因为不能识别唯一键,不能访问远程数据。"

   //建立XY空间方案
   MapInfo.Data.SpatialSchemaXY xy = new MapInfo.Data.SpatialSchemaXY();
   xy.XColumn = "X";
   xy.YColumn = "Y";
   xy.NullPoint = "0.0, 0.0";
   xy.StyleType = MapInfo.Data.StyleType.None;
   xy.DefaultStyle = new MapInfo.Styles.CompositeStyle();
   xy.CoordSys = MapInfo.Engine.Session.Current.CoordSysFactory.CreateLongLat(MapInfo.Geometry.DatumID.WGS84);

   //建立TableInfo
   MapInfo.Data.TableInfoServer ti = new MapInfo.Data.TableInfoServer("Customers","Driver={SQL Server};Server=LIXIAOHUI;Database=test;Uid=sa;Pwd=sa;","select * from Us_Cust",MapInfo.Data.ServerToolkit.Odbc);
   ti.SpatialSchema = xy;
   MapInfo.Data.Table miCustomers = MapInfo.Engine.Session.Current.Catalog.OpenTable (ti);
   MapInfo.Mapping.FeatureLayer featureLayer = new MapInfo.Mapping.FeatureLayer(miCustomers);
   mapControl1.Map.Layers.Add(featureLayer);
   mapControl1.Map.SetView(featureLayer);

3.如何查看整个地图
Map map = mapControl1.Map;
IMapLayerFilter lyrFilter = MapLayerFilterFactory.FilterByType(typeof(FeatureLayer));
MapLayerEnumerator lyrEnum= map.Layers.GetMapLayerEnumerator(lyrFilter);
map.SetView(lyrEnum);
或者:
   Map map = mapControl1.Map;
   IMapLayerFilter lyrFilter = new FilterByLayerType(LayerType.Normal);
   MapLayerEnumerator lyrEnum= map.Layers.GetMapLayerEnumerator(lyrFilter);
   map.SetView(lyrEnum);