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

Added extration of line coordinates in btnCalcStress_Click event

parent c020921c
Branches
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -99,12 +99,38 @@ namespace MES_Wind
return;
}
pwlLayer = map1.GetLineLayers()[0];
//Now we get the Feature set for the lines
IFeatureSet featureSet = pwlLayer.DataSet;
IList<Coordinate> coordinateList = featureSet.Features[0].Coordinates;
//copy line layer FeatureSet
IFeatureSet pwlineSet = pwlLayer.DataSet;
// new FeatureSet for resulting broken powerlines
IFeatureSet brklineSet = new FeatureSet(FeatureType.Line);
DataTable dt = pwlineSet.DataTable;
foreach (IFeature feature in pwlineSet.Features)
{
LineString linestr = feature.BasicGeometry as LineString;
if (linestr != null)
{ // case if powerline consists of one line
// get coordinates list
IList<Coordinate> points = linestr.Coordinates;
IFeature brklineFeature = brklineSet.AddFeature(linestr);
brklineFeature.CopyAttributes(feature);
}
else
{//case if powerline is multiline
MultiLineString multiline = feature.BasicGeometry as MultiLineString;
if ( multiline != null){
foreach (IGeometry line in multiline.Geometries)
{
IList<Coordinate> points = line.Coordinates;
}
IFeature brklineFeature = brklineSet.AddFeature(multiline);
MessageBox.Show("Works");
}
}
}
}
catch (Exception ex)
......
No preview for this file type
No preview for this file type
No preview for this file type
<MapWinGIS OcxVersion="4.8" FileType="LayerFile" FileVersion="0" Description="">
<Layer LayerType="Shapefile" LayerName="pwrLine" LayerVisible="1" LayerKey="" Filename="">
<ShapefileClass>
<DefaultDrawingOptions FillColor="16777215" LineColor="5148519">
<DefaultDrawingOptions FillColor="16777215" LineColor="5148519" UseLinePattern="96">
<LinePatternClass Key="" Transparency="255">
<LineSegments>
<LineSegmentClass LineType="0" Color="5148519" MarkerOutlineColor="7895160" LineWidth="1.000000" MarkerSize="12.000000" MarkerInterval="16.000000" MarkerOffset="0.000000" LineStyle="0" Marker="2" MarkerOrientation="1" MarkerFlipFirst="-1" />
......@@ -10,7 +10,7 @@
</DefaultDrawingOptions>
<ShapefileCategoriesClass>
<ShapefileCategoryClass Name="110kW" Expression="[Power] = 110">
<ShapeDrawingOptionsClass FillColor="16777215" LineColor="5148519">
<ShapeDrawingOptionsClass FillColor="16777215" LineColor="5148519" UseLinePattern="96">
<LinePatternClass Key="" Transparency="255">
<LineSegments>
<LineSegmentClass LineType="0" Color="5148519" MarkerOutlineColor="7895160" LineWidth="1.000000" MarkerSize="12.000000" MarkerInterval="16.000000" MarkerOffset="0.000000" LineStyle="0" Marker="2" MarkerOrientation="1" MarkerFlipFirst="-1" />
......@@ -23,7 +23,7 @@
</ShapefileCategoryClass>
</ShapefileCategoriesClass>
<LabelsClass Generated="0" AvoidCollisions="0" Positioning="6" TextRenderingHint="5" />
<ChartsClass />
<ChartsClass ValuesFontName="" />
<Selection TotalCount="3" SelectedCount="1">010</Selection>
</ShapefileClass>
</Layer>
......
<Mapwin name="MapWindow+GIS+*" type="projectfile.2" version="4.8.8">
<MapWinGIS OcxVersion="4.8" FileType="MapState" FileVersion="0">
<MapState SendMouseMove="1" SendMouseDown="1" SendMouseUp="1" SendSelectBoxFinal="1" CursorMode="1" TrapRightMouseDown="1" ShowVersionNumber="1" ExtentsLeft="3646653.952110" ExtentsRight="3658915.336707" ExtentsBottom="5500371.405636" ExtentsTop="5507634.789351" ExtentsPad="0.020000" />
<Layers>
<Layer LayerType="Shapefile" LayerName="pwrLine" LayerVisible="1" LayerKey="" Filename="pwrLine.shp">
<ShapefileClass>
<DefaultDrawingOptions FillColor="16777215" LineColor="5148519">
<LinePatternClass Key="" Transparency="255">
<LineSegments>
<LineSegmentClass LineType="0" Color="5148519" MarkerOutlineColor="7895160" LineWidth="1.000000" MarkerSize="12.000000" MarkerInterval="16.000000" MarkerOffset="0.000000" LineStyle="0" Marker="2" MarkerOrientation="1" MarkerFlipFirst="-1" />
</LineSegments>
</LinePatternClass>
</DefaultDrawingOptions>
<ShapefileCategoriesClass>
<ShapefileCategoryClass Name="110kW" Expression="[Power] = 110">
<ShapeDrawingOptionsClass FillColor="16777215" LineColor="5148519">
<LinePatternClass Key="" Transparency="255">
<LineSegments>
<LineSegmentClass LineType="0" Color="5148519" MarkerOutlineColor="7895160" LineWidth="1.000000" MarkerSize="12.000000" MarkerInterval="16.000000" MarkerOffset="0.000000" LineStyle="0" Marker="2" MarkerOrientation="1" MarkerFlipFirst="-1" />
</LineSegments>
</LinePatternClass>
</ShapeDrawingOptionsClass>
</ShapefileCategoryClass>
<ShapefileCategoryClass Name="35kW" Expression="[Power] = 35">
<ShapeDrawingOptionsClass FillColor="16777215" LineColor="10040879" />
</ShapefileCategoryClass>
</ShapefileCategoriesClass>
<LabelsClass Generated="0" AvoidCollisions="0" Positioning="6" TextRenderingHint="5" />
<ChartsClass ValuesFontName="" />
</ShapefileClass>
</Layer>
</Layers>
</MapWinGIS>
<MapWindow4 ConfigurationPath="..\..\..\..\..\AppData\Roaming\MapWindow\mapwindow.mwcfg" ProjectProjection="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs" MapUnits="Meters" StatusBarAlternateCoordsNumDecimals="3" StatusBarCoordsNumDecimals="3" StatusBarAlternateCoordsUseCommas="True" StatusBarCoordsUseCommas="True" ShowFloatingScaleBar="False" FloatingScaleBarPosition="LowerRight" FloatingScaleBarUnit="" FloatingScaleBarForecolor="-16777216" FloatingScaleBarBackcolor="-1" MapResizeBehavior="0" ShowStatusBarCoords_Projected="True" ShowStatusBarCoords_Alternate="Lat/Long" SaveShapeSettings="False" ViewBackColor_UseDefault="True" ViewBackColor="16777215" ProjectProjectionWKT="PROJCS[&quot;WGS 84 / Pseudo-Mercator&quot;,GEOGCS[&quot;WGS 84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;WGS 84&quot;,6378137,298.257223563,AUTHORITY[&quot;EPSG&quot;,&quot;7030&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;6326&quot;]],PRIMEM[&quot;Greenwich&quot;,0,AUTHORITY[&quot;EPSG&quot;,&quot;8901&quot;]],UNIT[&quot;degree&quot;,0.0174532925199433,AUTHORITY[&quot;EPSG&quot;,&quot;9122&quot;]],AUTHORITY[&quot;EPSG&quot;,&quot;4326&quot;]],PROJECTION[&quot;Mercator_1SP&quot;],PARAMETER[&quot;central_meridian&quot;,0],PARAMETER[&quot;scale_factor&quot;,1],PARAMETER[&quot;false_easting&quot;,0],PARAMETER[&quot;false_northing&quot;,0],UNIT[&quot;metre&quot;,1,AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]],AXIS[&quot;X&quot;,EAST],AXIS[&quot;Y&quot;,NORTH],EXTENSION[&quot;PROJ4&quot;,&quot;+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs&quot;],AUTHORITY[&quot;EPSG&quot;,&quot;3857&quot;]]">
<Plugins>
<Plugin SettingsString="" Key="GridAnalysisTool_MainPlugin" />
<Plugin SettingsString="" Key="ImgRegPluginCSharp_Classes_ImgReg" />
<Plugin SettingsString="" Key="ArchiveTool_mwArchiveTool" />
<Plugin SettingsString="" Key="mwGPX_mwGPX" />
<Plugin SettingsString="" Key="ShapefileEditor_ShapefileEditorClass" />
</Plugins>
<ApplicationPlugins PluginDir="..\..\..\..\..\Program Files (x86)\MapWindow\ApplicationPlugins">
<Plugin SettingsString="Editable=False" Key="mwIdentifier_mwIdentPlugin" />
<Plugin SettingsString="" Key="measureProject_measureClass" />
<Plugin SettingsString="" Key="mwSymbology_SymbologyPlugin" />
<Plugin SettingsString="" Key="ToolboxExtra_Classes_Main" />
<Plugin SettingsString="" Key="TableEditorNew_Main" />
<Plugin SettingsString="" Key="GISTools_GisToolsPlugin" />
<Plugin SettingsString="" Key="mwLayout_LayoutPlugin" />
</ApplicationPlugins>
<Bookmarks />
<PreviewMap dx="0" dy="0" xllcenter="0" yllcenter="0">
<Image Type="">
</Image>
</PreviewMap>
<Groups>
<Group Name="Data Layers" Expanded="True" Position="0">
<Image Type="">
</Image>
</Group>
</Groups>
<Layers>
<Layer Name="pwrLine" Tag="" Expanded="True" Handle="0" PositionInGroup="0" GroupIndex="0" GroupName="Data Layers" />
</Layers>
</MapWindow4>
</Mapwin>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment