Skip to content
Snippets Groups Projects
Commit 8ac29be6 authored by Debolskiy Andrey's avatar Debolskiy Andrey :bicyclist_tone5:
Browse files

line output added to the map

parent 50d71634
No related branches found
No related tags found
No related merge requests found
......@@ -84,15 +84,14 @@ namespace MES_Wind
string file_path = System.IO.Directory.GetParent(System.IO.Directory.GetParent(curDir).FullName).FullName + pathToTests;
string test = file_path + "u_test.asc";
map1.AddLayer(file_path + "powerstations.shp");
map1.AddLayer(file_path+"u_test.asc");
map1.AddLayer(file_path + "v_test.asc");
map1.AddLayer(file_path + "clim5_test.asc");
map1.AddLayer(file_path + "clim10_test.asc");
map1.AddLayer(file_path + "clim15_test.asc");
map1.AddLayer(file_path + "powerlines.shp");
map1.AddLayer(file_path + "powerstations.shp");
map1.ZoomToMaxExtent();
//map1.ZoomToMaxExtent();
}
private void btnCalcStress_Click(object sender, EventArgs e)
......@@ -245,18 +244,36 @@ namespace MES_Wind
disabledPointSet.AddFeature(disabledPointFeature);
}
//add result layer to the map
IMapPointLayer resultPointLayer = default(MapPointLayer);
IMapPointLayer resultPointLayer = (MapPointLayer)map1.Layers.Add(disabledPointSet);
PointSymbolizer symbol = new PointSymbolizer('a', "serif", Color.Blue, 4);
resultPointLayer.Symbolizer = symbol;
resultPointLayer.LegendText = "Disabled TransStations";
resultPointLayer = (MapPointLayer)map1.Layers.Add(disabledPointSet);
//New FeatureSet
foreach (WindStressPRM.Powerline diabledLine in output.disabledLines)
//New FeatureSet for disabled powerlines
IFeatureSet disabledLineSet = new FeatureSet(FeatureType.Line);
disabledLineSet.Projection = map1.Projection;
DataColumn lineIDcolumn = new DataColumn("ID");
disabledLineSet.DataTable.Columns.Add(lineIDcolumn);
int lineID = 0;
foreach (WindStressPRM.Powerline disabledLine in output.disabledLines)
{
List<Coordinate> lineArray = new List<Coordinate>();
foreach (WindStressPRM.Coordinate prmcoordinate in disabledLine.coords)
{
Coordinate lineVerticeCoords = new Coordinate(prmcoordinate.X, prmcoordinate.Y);
lineArray.Add(lineVerticeCoords);
}
LineString lineGeometry = new LineString(lineArray);
IFeature lineFeature = disabledLineSet.AddFeature(lineGeometry);
lineID = disabledLine.identifier;
lineFeature.DataRow["ID"] = lineID;
}
//add resulting layer to the map
IMapLineLayer disabledLineLayer = (MapLineLayer)map1.Layers.Add(disabledLineSet);
LineSymbolizer lineSymbol = new LineSymbolizer(Color.Red, 3);
disabledLineLayer.Symbolizer = lineSymbol;
disabledLineLayer.LegendText = "Disabled Lines";
// new FeatureSet for resulting broken powerlines
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment