mapxtreme 添加图元
来源:互联网 发布:拍短片的软件 编辑:程序博客网 时间:2024/05/16 07:52
Table tblTemp1 = Session.Current.Catalog.GetTable("lyrPPHOLine");
tblTemp1.BeginAccess(TableAccessMode.Write);
//==================================================================================
CoordSys crdsys = ConstPar.map.GetDisplayCoordSys();
Feature ftr = new Feature(tblTemp.TableInfo.Columns);
frmp.Show();
frmp.TopMost = true;
frmp.ProgressBar1.Maximum = dt.Rows.Count + 10;
frmp.ProgressBar1.Value = 0;
frmp.Label1.Text = @"开始处理:...";
DataTable dtxy = new DataTable("dtxy");
DataColumn dc1 = new DataColumn("Lon");
dc1.DataType = System.Type.GetType("System.String");
dtxy.Columns.Add(dc1);
DataColumn dc2 = new DataColumn("Lat");
dc2.DataType = System.Type.GetType("System.String");
dtxy.Columns.Add(dc2);
Int32 i = 0;
foreach (DataRow dr in dt.Rows)
{
double x1 = 0;
double y1 = 0;
double x2 = 0;
double y2 = 0;
double x3 = 0;
double y3 = 0;
//====================================
try
{
x1 = Convert.ToDouble(dr["Long"]);
}
catch (Exception ex)
{
Debug.Print(ex.ToString());
}
try
{
y1 = Convert.ToDouble(dr["Lat"]);
}
catch (Exception ex)
{
Debug.Print(ex.ToString());
}
//===================================
try
{
string cn = dr["LAC_CI"].ToString();
if (cn.Trim().Length > 0)
{
SearchFeature(cn, ref x2, ref y2);
}
}
catch (Exception ex)
{
ConLog.Writelog(ex.ToString());
}
//=====================================
try
{
string cn = dr["Oldcellid"].ToString();
if (cn.Trim().Length > 0)
{
SearchFeature(cn, ref x3, ref y3);
}
}
catch (Exception ex)
{
ConLog.Writelog(ex.ToString());
}
//=========================================
if (x1 > 0 & y1 > 0)
{
DataRow drow = null;
drow = dtxy.NewRow();
drow[0] = x1;
drow[1] = y1;
dtxy.Rows.Add(drow);
//=========添加点======
FeatureGeometry pt = new MapInfo.Geometry.Point((new FeatureLayer(tblTemp)).CoordSys, x1,
y1);
FontPointStyle sty = new FontPointStyle();
sty.Code = 35;
sty.PointSize = 6;
sty.Color = System.Drawing.Color.DarkGreen;
sty.Font.Name = "MapInfo Symbols";
ftr.Geometry = pt;
ftr.Style = sty;
tblTemp.InsertFeature(ftr);
//===================
}
if (x1 != 0 & y1 != 0 & y2 != 0 & y2 != 0)
{
CreateLine(x1, y1, x2, y2, Color.LimeGreen, "lyrPPHOLine", "", 2);
}
if (x1 != 0 & y1 != 0 & x3 != 0 & y3 != 0)
{
CreateLine(x1, y1, x3, y3, Color.OrangeRed, "lyrPPHOLine", "", 2);
}
i = i + 1;
frmp.ProgressBar1.Value = i;
frmp.Label1.Text = "开始处理:... " + i.ToString() + "/" + (dt.Rows.Count + 10).ToString();
Application.DoEvents();
}
tblTemp.EndAccess();
//tabinfo.WriteTabFile();
//保存Point tab文件
tblTemp1.BeginAccess(TableAccessMode.Write);
//==================================================================================
CoordSys crdsys = ConstPar.map.GetDisplayCoordSys();
Feature ftr = new Feature(tblTemp.TableInfo.Columns);
frmp.Show();
frmp.TopMost = true;
frmp.ProgressBar1.Maximum = dt.Rows.Count + 10;
frmp.ProgressBar1.Value = 0;
frmp.Label1.Text = @"开始处理:...";
DataTable dtxy = new DataTable("dtxy");
DataColumn dc1 = new DataColumn("Lon");
dc1.DataType = System.Type.GetType("System.String");
dtxy.Columns.Add(dc1);
DataColumn dc2 = new DataColumn("Lat");
dc2.DataType = System.Type.GetType("System.String");
dtxy.Columns.Add(dc2);
Int32 i = 0;
foreach (DataRow dr in dt.Rows)
{
double x1 = 0;
double y1 = 0;
double x2 = 0;
double y2 = 0;
double x3 = 0;
double y3 = 0;
//====================================
try
{
x1 = Convert.ToDouble(dr["Long"]);
}
catch (Exception ex)
{
Debug.Print(ex.ToString());
}
try
{
y1 = Convert.ToDouble(dr["Lat"]);
}
catch (Exception ex)
{
Debug.Print(ex.ToString());
}
//===================================
try
{
string cn = dr["LAC_CI"].ToString();
if (cn.Trim().Length > 0)
{
SearchFeature(cn, ref x2, ref y2);
}
}
catch (Exception ex)
{
ConLog.Writelog(ex.ToString());
}
//=====================================
try
{
string cn = dr["Oldcellid"].ToString();
if (cn.Trim().Length > 0)
{
SearchFeature(cn, ref x3, ref y3);
}
}
catch (Exception ex)
{
ConLog.Writelog(ex.ToString());
}
//=========================================
if (x1 > 0 & y1 > 0)
{
DataRow drow = null;
drow = dtxy.NewRow();
drow[0] = x1;
drow[1] = y1;
dtxy.Rows.Add(drow);
//=========添加点======
FeatureGeometry pt = new MapInfo.Geometry.Point((new FeatureLayer(tblTemp)).CoordSys, x1,
y1);
FontPointStyle sty = new FontPointStyle();
sty.Code = 35;
sty.PointSize = 6;
sty.Color = System.Drawing.Color.DarkGreen;
sty.Font.Name = "MapInfo Symbols";
ftr.Geometry = pt;
ftr.Style = sty;
tblTemp.InsertFeature(ftr);
//===================
}
if (x1 != 0 & y1 != 0 & y2 != 0 & y2 != 0)
{
CreateLine(x1, y1, x2, y2, Color.LimeGreen, "lyrPPHOLine", "", 2);
}
if (x1 != 0 & y1 != 0 & x3 != 0 & y3 != 0)
{
CreateLine(x1, y1, x3, y3, Color.OrangeRed, "lyrPPHOLine", "", 2);
}
i = i + 1;
frmp.ProgressBar1.Value = i;
frmp.Label1.Text = "开始处理:... " + i.ToString() + "/" + (dt.Rows.Count + 10).ToString();
Application.DoEvents();
}
tblTemp.EndAccess();
//tabinfo.WriteTabFile();
//保存Point tab文件
- mapxtreme 添加图元
- Mapxtreme图元变更
- MapXtreme 图层操作 创建临时图层-添加图元-加图层标注-清除图元
- MapXtreme图元改变样式
- MapXtreme+ASP在图层上选择图元
- MapXtreme+ASP在图层上删除图元
- MapXtreme 地图搜索之图元定位
- MapXtreme for java 图元和搜索
- MapXtreme+ASP自定义图元样式及更新图元
- 在Mapxtreme中修改单个图元的标注
- 在Mapxtreme中修改单个图元的标注
- MapXtreme图元选择并改变样式显示方法总结
- MapXtreme+C#添加标注
- 初探GIS Mapxtreme 修改图元样式 实现图元闪烁
- asp+mapxtreme的示例代码-通过layerinfo添加图层并增加一个点
- Mapxtreme for Java中添加自定义图标
- C#MapX添加图元
- 初次使用MapXtreme主题图
- 在WPF中自定义控件(3) CustomControl (下)
- Silverlight POST请求并返回数据后保存文件
- servlet应用
- PB-日志-系统函数2.13.7Match()、MatchW()
- 黑马程序员:反射的应用
- mapxtreme 添加图元
- No 105 · Web项目打包(自动创建iis和自动附加数据库)
- 求A的读数,你还记得怎么算吗?
- YUV相关色彩空间模型
- simulink模块图形的线宽调节
- 《java常用方法大全》
- DM8168-EZSDK
- Broadcast Receiver
- Spring中Aspectj和Schema-based AOP混用引起的错误