diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 4320c71..e833e5f 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -269,8 +269,37 @@
return result;
}
+ ///
+ /// 获取特定区域图层的管线列表,并将其总长度统计出来
+ /// TODOLIST:将Intersects_Pipeline在MainFrm中去除
+ ///
+ ///
+ ///
+ public static GSOFeatures getLayerPipes(GSOGeoPolygon3D polygon, GSOLayer layer, out double length)
+ {
+ length = 0;
+ if (layer == null) return null;
+ GSOFeatureLayer flayer = layer as GSOFeatureLayer;
+ GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset;
+ GSOFeatures feats = null;
+ feats = polygon == null?flayer.GetAllFeatures():flayer.FindFeaturesInPolygon(polygon, false);
+
+ double totallength = 0.00;
+ for (int i = 0; i < feats.Length; i++)
+ {
+ GSOFeature feat = feats[i];
+ GSOGeoPolyline3D line = feat.Geometry as GSOGeoPolyline3D;
+ if (line == null) continue;
+
+ double pipeLength = line.GetSpaceLength(true, 6378137);
+ totallength += pipeLength;
+ }
+ //double toLength = Convert.ToDouble(totallength.ToString().Substring(0, totallength.ToString().IndexOf(".")));
+ length = Math.Floor(totallength);
+ return feats;
+ }
}
}
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 4320c71..e833e5f 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -269,8 +269,37 @@
return result;
}
+ ///
+ /// 获取特定区域图层的管线列表,并将其总长度统计出来
+ /// TODOLIST:将Intersects_Pipeline在MainFrm中去除
+ ///
+ ///
+ ///
+ public static GSOFeatures getLayerPipes(GSOGeoPolygon3D polygon, GSOLayer layer, out double length)
+ {
+ length = 0;
+ if (layer == null) return null;
+ GSOFeatureLayer flayer = layer as GSOFeatureLayer;
+ GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset;
+ GSOFeatures feats = null;
+ feats = polygon == null?flayer.GetAllFeatures():flayer.FindFeaturesInPolygon(polygon, false);
+
+ double totallength = 0.00;
+ for (int i = 0; i < feats.Length; i++)
+ {
+ GSOFeature feat = feats[i];
+ GSOGeoPolyline3D line = feat.Geometry as GSOGeoPolyline3D;
+ if (line == null) continue;
+
+ double pipeLength = line.GetSpaceLength(true, 6378137);
+ totallength += pipeLength;
+ }
+ //double toLength = Convert.ToDouble(totallength.ToString().Substring(0, totallength.ToString().IndexOf(".")));
+ length = Math.Floor(totallength);
+ return feats;
+ }
}
}
diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs
index 0c39575..4c149e0 100644
--- a/FrmAllPipelineStatis.cs
+++ b/FrmAllPipelineStatis.cs
@@ -14,63 +14,99 @@
{
public partial class FrmAllPipelineStatis : DevComponents.DotNetBar.Office2007Form
{
- Dictionary pipelineLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
- int type;
+ //Dictionary pipelineLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
+ //int type;
+ //static FrmAllPipelineStatis frm;
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ //DataTable table = new DataTable();
+ //string strLable = "";
+
static FrmAllPipelineStatis frm;
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
- DataTable table = new DataTable();
- string strLable = "";
+ private Dictionary nameAndPipesMap = null;
+ private Dictionary nameAndLengthMap = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
+ private List pipeLayerNames;
+ private static bool isSpaceQuery = false;
- public static void ShowForm(int _type, Dictionary pipeLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //public static void ShowForm(int _type, Dictionary pipeLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //{
+ // if (frm == null)
+ // {
+ // frm = new FrmAllPipelineStatis(_type, pipeLen, _list, ctl, InitDataGridViewX1);
+ // frm.Show(ctl.Parent);
+ // }
+ // else
+ // {
+ // if (frm.WindowState == FormWindowState.Minimized)
+ // {
+ // frm.WindowState = FormWindowState.Normal;
+ // }
+ // }
+ //}
+ public static void ShowForm(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1,List pipeLayerNames)
{
+ isSpaceQuery = true;
if (frm == null)
{
- frm = new FrmAllPipelineStatis(_type, pipeLen, _list, ctl, InitDataGridViewX1);
+ frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames);
frm.Show(ctl.Parent);
}
- else
+ else if (frm.WindowState == FormWindowState.Minimized)
{
- if (frm.WindowState == FormWindowState.Minimized)
- {
- frm.WindowState = FormWindowState.Normal;
- }
+ frm.WindowState = FormWindowState.Normal;
}
}
+ //public FrmAllPipelineStatis(int _type, Dictionary pipeLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // type = _type;
+ // pipelineLengthAndType = pipeLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = InitDataGridViewX1;
- public FrmAllPipelineStatis(int _type, Dictionary pipeLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //}
+ public FrmAllPipelineStatis(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, List pipeLayerNames)
{
InitializeComponent();
- type = _type;
- pipelineLengthAndType = pipeLen;
- list = _list;
+ this.Text = isSpaceQuery ? "空间查询" : "管线距离统计";
+ isSpaceQuery = false;
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
+ this.pipeLayerNames = pipeLayerNames;
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
- {
+ {
+ initPipesMap(polygon, out nameAndLengthMap, out nameAndPipesMap);
+ drawChart();
+ }
+
+ private void drawChart() {
try
{
- if (type == 0)
- {
- Text = "管线距离统计";
- }
- else
- {
- Text = "空间查询";
- }
-
+ //if (type == 0)
+ //{
+ // Text = "管线距离统计";
+ //}
+ //else
+ //{
+ // Text = "空间查询";
+ //}
chartAllAreaPipeline.Series.Add("管线");
-
+
// Set axis title
chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisX.Title = "管线类型";
chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisY.Title = "管线长度(米)";
- chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisX.Interval = 1;
+ chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisX.Interval = 1;
LabelStyle labeStyleAxisX = new LabelStyle();
labeStyleAxisX.Angle = -45;
labeStyleAxisX.Enabled = true;
@@ -78,16 +114,16 @@
chartAllAreaPipeline.Series["管线"].ChartType = SeriesChartType.Column;
chartAllAreaPipeline.Series["管线"]["DrawingStyle"] = "Cylinder";
-
- chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values);
- for (int m = 0; m < pipelineLengthAndType.Values.Count; m++)
+
+ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(nameAndLengthMap.Keys, nameAndLengthMap.Values);
+ for (int m = 0; m < nameAndLengthMap.Values.Count; m++)
{
if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0")
{
chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString();
}
string axisLabel = chartAllAreaPipeline.Series["管线"].Points[m].AxisLabel;
- chartAllAreaPipeline.Series["管线"].Points[m].AxisLabel = axisLabel.Substring(0, axisLabel.IndexOf("管线"));
+ chartAllAreaPipeline.Series["管线"].Points[m].AxisLabel = axisLabel.Substring(0, axisLabel.IndexOf("管线"));
}
}
catch (Exception ex)
@@ -95,43 +131,41 @@
LogError.PublishError(ex);
}
}
-
-
private void chartAllAreaPipeline_MouseClick(object sender, MouseEventArgs e)
{
HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true);
int indexHit = result.PointIndex;
- if (indexHit >= 0)
+ if (indexHit < 0) return;
+
+ //GSOFeatures fs = list[indexHit];
+
+ string pipetype = chartAllAreaPipeline.Series["管线"].Points[indexHit].AxisLabel+"管线";
+ //foreach (string key in nameAndPipesMap.Keys)
+ //{
+ // if (key.StartsWith(pipetype))
+ // {
+ // pipetype = key;
+ // break;
+ // }
+ //}
+
+ //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipetype);
+ //if (layer == null)
+ //{
+ // return;
+ //}
+ GSOFeatures fs = nameAndPipesMap[pipetype];
+ string[] fields = ClassSearchAnalysis.getFields(pipetype, globeControl1);
+ DataTable table = ClassSearchAnalysis.convertGSOFeatures2DataTable(fs, fields);
+
+ if (table != null && table.Rows.Count > 0)
{
- GSOFeatures fs = list[indexHit];
-
- string pipetype = chartAllAreaPipeline.Series["管线"].Points[indexHit].AxisLabel;
- foreach (string key in pipelineLengthAndType.Keys)
- {
- if (key.StartsWith(pipetype))
- {
- pipetype = key;
- break;
- }
- }
-
- GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipetype);
- if (layer == null)
- {
- return;
- }
-
- string[] fields = ClassSearchAnalysis.getFields(pipetype, globeControl1);
- table = ClassSearchAnalysis.convertGSOFeatures2DataTable(fs, fields);
-
- if (table != null && table.Rows.Count > 0)
- {
- string strLable = "共有:" + Convert.ToString(table.Rows.Count) + "条记录"
- + " 管线里程:" + chartAllAreaPipeline.Series["管线"].Points[indexHit].YValues[0].ToString("0.00")
- + " 米";
- m_InitDataGridViewX1(table, strLable, pipetype, true);
- }
+ string strLable = "共有:" + Convert.ToString(table.Rows.Count) + "条记录"
+ + " 管线里程:" + chartAllAreaPipeline.Series["管线"].Points[indexHit].YValues[0].ToString("0.00")
+ + " 米";
+ m_InitDataGridViewX1(table, strLable, pipetype, true);
}
+
}
private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e)
@@ -150,7 +184,8 @@
private void FrmAllPipelineStatis_FormClosing(object sender, FormClosingEventArgs e)
{
frm = null;
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
@@ -160,6 +195,25 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chartAllAreaPipeline);
frm.Show();
}
+ ///
+ /// 得到某图层区域内管线的map以及区域内管线长度的map
+ ///
+ ///
+ public void initPipesMap(GSOGeoPolygon3D polygon,out Dictionary pipeAndLength,out Dictionary nameAndPipeMap)
+ {
+ pipeAndLength = new Dictionary();
+ nameAndPipeMap = new Dictionary();
+ for (int i = 0; i < pipeLayerNames.Count; i++)
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipeLayerNames[i]);
+ double totalLength = 0.0;
+ GSOFeatures fs = FeatureStatisticsService.getLayerPipes(polygon, layer,out totalLength);
+ if (fs == null) continue;
+ nameAndPipeMap.Add(pipeLayerNames[i], fs);
+ nameAndLengthMap.Add(pipeLayerNames[i],totalLength);
+
+ }
+ }
}
}
\ No newline at end of file
diff --git a/FeatureStatisticsService.cs b/FeatureStatisticsService.cs
index 4320c71..e833e5f 100644
--- a/FeatureStatisticsService.cs
+++ b/FeatureStatisticsService.cs
@@ -269,8 +269,37 @@
return result;
}
+ ///
+ /// 获取特定区域图层的管线列表,并将其总长度统计出来
+ /// TODOLIST:将Intersects_Pipeline在MainFrm中去除
+ ///
+ ///
+ ///
+ public static GSOFeatures getLayerPipes(GSOGeoPolygon3D polygon, GSOLayer layer, out double length)
+ {
+ length = 0;
+ if (layer == null) return null;
+ GSOFeatureLayer flayer = layer as GSOFeatureLayer;
+ GSOFeatureDataset fdataset = flayer.Dataset as GSOFeatureDataset;
+ GSOFeatures feats = null;
+ feats = polygon == null?flayer.GetAllFeatures():flayer.FindFeaturesInPolygon(polygon, false);
+
+ double totallength = 0.00;
+ for (int i = 0; i < feats.Length; i++)
+ {
+ GSOFeature feat = feats[i];
+ GSOGeoPolyline3D line = feat.Geometry as GSOGeoPolyline3D;
+ if (line == null) continue;
+
+ double pipeLength = line.GetSpaceLength(true, 6378137);
+ totallength += pipeLength;
+ }
+ //double toLength = Convert.ToDouble(totallength.ToString().Substring(0, totallength.ToString().IndexOf(".")));
+ length = Math.Floor(totallength);
+ return feats;
+ }
}
}
diff --git a/FrmAllPipelineStatis.cs b/FrmAllPipelineStatis.cs
index 0c39575..4c149e0 100644
--- a/FrmAllPipelineStatis.cs
+++ b/FrmAllPipelineStatis.cs
@@ -14,63 +14,99 @@
{
public partial class FrmAllPipelineStatis : DevComponents.DotNetBar.Office2007Form
{
- Dictionary pipelineLengthAndType = new Dictionary();
- List list = new List();
- GSOGlobeControl globeControl1;
- int type;
+ //Dictionary pipelineLengthAndType = new Dictionary();
+ //List list = new List();
+ //GSOGlobeControl globeControl1;
+ //int type;
+ //static FrmAllPipelineStatis frm;
+ //private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
+ //DataTable table = new DataTable();
+ //string strLable = "";
+
static FrmAllPipelineStatis frm;
private MainFrm.DataGridViewDelegate m_InitDataGridViewX1;
- DataTable table = new DataTable();
- string strLable = "";
+ private Dictionary nameAndPipesMap = null;
+ private Dictionary nameAndLengthMap = null;
+ private GSOGlobeControl globeControl1;
+ private GSOGeoPolygon3D polygon;
+ private List pipeLayerNames;
+ private static bool isSpaceQuery = false;
- public static void ShowForm(int _type, Dictionary pipeLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //public static void ShowForm(int _type, Dictionary pipeLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //{
+ // if (frm == null)
+ // {
+ // frm = new FrmAllPipelineStatis(_type, pipeLen, _list, ctl, InitDataGridViewX1);
+ // frm.Show(ctl.Parent);
+ // }
+ // else
+ // {
+ // if (frm.WindowState == FormWindowState.Minimized)
+ // {
+ // frm.WindowState = FormWindowState.Normal;
+ // }
+ // }
+ //}
+ public static void ShowForm(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1,List pipeLayerNames)
{
+ isSpaceQuery = true;
if (frm == null)
{
- frm = new FrmAllPipelineStatis(_type, pipeLen, _list, ctl, InitDataGridViewX1);
+ frm = new FrmAllPipelineStatis(ctl,polygon, InitDataGridViewX1,pipeLayerNames);
frm.Show(ctl.Parent);
}
- else
+ else if (frm.WindowState == FormWindowState.Minimized)
{
- if (frm.WindowState == FormWindowState.Minimized)
- {
- frm.WindowState = FormWindowState.Normal;
- }
+ frm.WindowState = FormWindowState.Normal;
}
}
+ //public FrmAllPipelineStatis(int _type, Dictionary pipeLen, List _list,
+ // GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //{
+ // InitializeComponent();
+ // type = _type;
+ // pipelineLengthAndType = pipeLen;
+ // list = _list;
+ // globeControl1 = ctl;
+ // m_InitDataGridViewX1 = InitDataGridViewX1;
- public FrmAllPipelineStatis(int _type, Dictionary pipeLen, List _list,
- GSOGlobeControl ctl, MainFrm.DataGridViewDelegate InitDataGridViewX1)
+ //}
+ public FrmAllPipelineStatis(GSOGlobeControl ctl, GSOGeoPolygon3D polygon, MainFrm.DataGridViewDelegate InitDataGridViewX1, List pipeLayerNames)
{
InitializeComponent();
- type = _type;
- pipelineLengthAndType = pipeLen;
- list = _list;
+ this.Text = isSpaceQuery ? "空间查询" : "管线距离统计";
+ isSpaceQuery = false;
globeControl1 = ctl;
m_InitDataGridViewX1 = InitDataGridViewX1;
+ this.polygon = polygon;
+ this.pipeLayerNames = pipeLayerNames;
}
private void FrmAllPipelineStatis_Load(object sender, EventArgs e)
- {
+ {
+ initPipesMap(polygon, out nameAndLengthMap, out nameAndPipesMap);
+ drawChart();
+ }
+
+ private void drawChart() {
try
{
- if (type == 0)
- {
- Text = "管线距离统计";
- }
- else
- {
- Text = "空间查询";
- }
-
+ //if (type == 0)
+ //{
+ // Text = "管线距离统计";
+ //}
+ //else
+ //{
+ // Text = "空间查询";
+ //}
chartAllAreaPipeline.Series.Add("管线");
-
+
// Set axis title
chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisX.Title = "管线类型";
chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisY.Title = "管线长度(米)";
- chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisX.Interval = 1;
+ chartAllAreaPipeline.ChartAreas["ChartArea1"].AxisX.Interval = 1;
LabelStyle labeStyleAxisX = new LabelStyle();
labeStyleAxisX.Angle = -45;
labeStyleAxisX.Enabled = true;
@@ -78,16 +114,16 @@
chartAllAreaPipeline.Series["管线"].ChartType = SeriesChartType.Column;
chartAllAreaPipeline.Series["管线"]["DrawingStyle"] = "Cylinder";
-
- chartAllAreaPipeline.Series["管线"].Points.DataBindXY(pipelineLengthAndType.Keys, pipelineLengthAndType.Values);
- for (int m = 0; m < pipelineLengthAndType.Values.Count; m++)
+
+ chartAllAreaPipeline.Series["管线"].Points.DataBindXY(nameAndLengthMap.Keys, nameAndLengthMap.Values);
+ for (int m = 0; m < nameAndLengthMap.Values.Count; m++)
{
if (chartAllAreaPipeline.Series["管线"].Points[m].YValues[0].ToString() != "0")
{
chartAllAreaPipeline.Series["管线"].Points[m].Label = chartAllAreaPipeline.Series[0].Points[m].YValues[0].ToString();
}
string axisLabel = chartAllAreaPipeline.Series["管线"].Points[m].AxisLabel;
- chartAllAreaPipeline.Series["管线"].Points[m].AxisLabel = axisLabel.Substring(0, axisLabel.IndexOf("管线"));
+ chartAllAreaPipeline.Series["管线"].Points[m].AxisLabel = axisLabel.Substring(0, axisLabel.IndexOf("管线"));
}
}
catch (Exception ex)
@@ -95,43 +131,41 @@
LogError.PublishError(ex);
}
}
-
-
private void chartAllAreaPipeline_MouseClick(object sender, MouseEventArgs e)
{
HitTestResult result = chartAllAreaPipeline.HitTest(e.X, e.Y, true);
int indexHit = result.PointIndex;
- if (indexHit >= 0)
+ if (indexHit < 0) return;
+
+ //GSOFeatures fs = list[indexHit];
+
+ string pipetype = chartAllAreaPipeline.Series["管线"].Points[indexHit].AxisLabel+"管线";
+ //foreach (string key in nameAndPipesMap.Keys)
+ //{
+ // if (key.StartsWith(pipetype))
+ // {
+ // pipetype = key;
+ // break;
+ // }
+ //}
+
+ //GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipetype);
+ //if (layer == null)
+ //{
+ // return;
+ //}
+ GSOFeatures fs = nameAndPipesMap[pipetype];
+ string[] fields = ClassSearchAnalysis.getFields(pipetype, globeControl1);
+ DataTable table = ClassSearchAnalysis.convertGSOFeatures2DataTable(fs, fields);
+
+ if (table != null && table.Rows.Count > 0)
{
- GSOFeatures fs = list[indexHit];
-
- string pipetype = chartAllAreaPipeline.Series["管线"].Points[indexHit].AxisLabel;
- foreach (string key in pipelineLengthAndType.Keys)
- {
- if (key.StartsWith(pipetype))
- {
- pipetype = key;
- break;
- }
- }
-
- GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipetype);
- if (layer == null)
- {
- return;
- }
-
- string[] fields = ClassSearchAnalysis.getFields(pipetype, globeControl1);
- table = ClassSearchAnalysis.convertGSOFeatures2DataTable(fs, fields);
-
- if (table != null && table.Rows.Count > 0)
- {
- string strLable = "共有:" + Convert.ToString(table.Rows.Count) + "条记录"
- + " 管线里程:" + chartAllAreaPipeline.Series["管线"].Points[indexHit].YValues[0].ToString("0.00")
- + " 米";
- m_InitDataGridViewX1(table, strLable, pipetype, true);
- }
+ string strLable = "共有:" + Convert.ToString(table.Rows.Count) + "条记录"
+ + " 管线里程:" + chartAllAreaPipeline.Series["管线"].Points[indexHit].YValues[0].ToString("0.00")
+ + " 米";
+ m_InitDataGridViewX1(table, strLable, pipetype, true);
}
+
}
private void chartAllAreaPipeline_MouseMove(object sender, MouseEventArgs e)
@@ -150,7 +184,8 @@
private void FrmAllPipelineStatis_FormClosing(object sender, FormClosingEventArgs e)
{
frm = null;
- m_InitDataGridViewX1(table, strLable, "", false);
+ globeControl1.Globe.ClearAnalysis();
+ m_InitDataGridViewX1(null, "", "", false);
}
@@ -160,6 +195,25 @@
PATM_Forms.F_PATMTitle frm = new PATM_Forms.F_PATMTitle("S", chartAllAreaPipeline);
frm.Show();
}
+ ///
+ /// 得到某图层区域内管线的map以及区域内管线长度的map
+ ///
+ ///
+ public void initPipesMap(GSOGeoPolygon3D polygon,out Dictionary pipeAndLength,out Dictionary nameAndPipeMap)
+ {
+ pipeAndLength = new Dictionary();
+ nameAndPipeMap = new Dictionary();
+ for (int i = 0; i < pipeLayerNames.Count; i++)
+ {
+ GSOLayer layer = globeControl1.Globe.Layers.GetLayerByCaption(pipeLayerNames[i]);
+ double totalLength = 0.0;
+ GSOFeatures fs = FeatureStatisticsService.getLayerPipes(polygon, layer,out totalLength);
+ if (fs == null) continue;
+ nameAndPipeMap.Add(pipeLayerNames[i], fs);
+ nameAndLengthMap.Add(pipeLayerNames[i],totalLength);
+
+ }
+ }
}
}
\ No newline at end of file
diff --git a/MainFrm.cs b/MainFrm.cs
index 167c5f2..9c7719f 100644
--- a/MainFrm.cs
+++ b/MainFrm.cs
@@ -2921,32 +2921,34 @@
break;
case "PipelineDistanceStatistics":
- pipeLineDis.Clear();
- List list1 = new List();
- for (int i = 0; i < m_PipelineLayerNames.Count; i++)
- {
- GSOFeatures fs = Intersects_Pipeline(polygon, m_PipelineLayerNames[i]);
- list1.Add(fs);
- }
+ //pipeLineDis.Clear();
+ //List list1 = new List();
+ //for (int i = 0; i < m_PipelineLayerNames.Count; i++)
+ //{
+ //GSOFeatures fs = Intersects_Pipeline(polygon, m_PipelineLayerNames[i]);
+ // list1.Add(fs);
+ //}
- FrmAllPipelineStatis frm1 = new FrmAllPipelineStatis(0, pipeLineDis, list1, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ //FrmAllPipelineStatis frm1 = new FrmAllPipelineStatis(0, pipeLineDis, list1, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmAllPipelineStatis frm1 = new FrmAllPipelineStatis(globeControl1, polygon, new DataGridViewDelegate(InitDataGridViewX1), m_PipelineLayerNames);
frm1.Show(this);
globeControl1.Globe.Action = EnumAction3D.ActionNull;
break;
case "PipelineSpatialQuery":
- pipeLineDis.Clear();
- List list2 = new List();
- for (int i = 0; i < m_PipelineLayerNames.Count; i++)
- {
- GSOFeatures fs = Intersects_Pipeline(polygon, m_PipelineLayerNames[i]);
- if (fs != null)
- {
- list2.Add(fs);
- }
- }
+ //pipeLineDis.Clear();
+ //List list2 = new List();
+ //for (int i = 0; i < m_PipelineLayerNames.Count; i++)
+ //{
+ // GSOFeatures fs = Intersects_Pipeline(polygon, m_PipelineLayerNames[i]);
+ // if (fs != null)
+ // {
+ // list2.Add(fs);
+ // }
+ //}
- FrmAllPipelineStatis.ShowForm(1, pipeLineDis, list2, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ //FrmAllPipelineStatis.ShowForm(1, pipeLineDis, list2, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmAllPipelineStatis.ShowForm(globeControl1,polygon,new DataGridViewDelegate(InitDataGridViewX1),m_PipelineLayerNames);
globeControl1.Globe.ClearAnalysis();
globeControl1.Globe.Action = EnumAction3D.ActionNull;
@@ -9661,16 +9663,17 @@
//日志记录
LogManager.saveLog(Utility.userName, "管线长度统计");
- pipeLineDis.Clear();
- List list = new List();
- for (int i = 0; i < m_PipelineLayerNames.Count; i++)
- {
- GSOFeatures fs = Intersects_Pipeline(null, m_PipelineLayerNames[i]);
- if (fs!=null)
- list.Add(fs);
- }
+ //pipeLineDis.Clear();
+ //List list = new List();
+ //for (int i = 0; i < m_PipelineLayerNames.Count; i++)
+ //{
+ // GSOFeatures fs = Intersects_Pipeline(null, m_PipelineLayerNames[i]);
+ // if (fs!=null)
+ // list.Add(fs);
+ //}
- FrmAllPipelineStatis frm = new FrmAllPipelineStatis(0, pipeLineDis, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ //FrmAllPipelineStatis frm = new FrmAllPipelineStatis(0, pipeLineDis, list, globeControl1, new DataGridViewDelegate(InitDataGridViewX1));
+ FrmAllPipelineStatis frm = new FrmAllPipelineStatis(globeControl1,null, new DataGridViewDelegate(InitDataGridViewX1), m_PipelineLayerNames);
frm.Show(this);
}