This page is dedicated to conversions from Mapwingis-VB to Mapwindow5-C#. It contains a bunch of samples from the first one and their equivalence in the second.

 

VB - Mawingis

C# - MW5

Point(0)

Points[0]

Dim shap As New MapWinGIS.Shape

shap.Create(MapWinGIS.ShpfileType.SHP_POINT) '        shap.InsertPart(0, 0)

shap.AddPoint(pnt.x, pnt.y)

Geometry g = new Geometry(Api.Enums.GeometryType.Point)

var XY = new Coordinate(x1, y1)

g.Points.Add(XY)

FeatureSet.Feature.EditAdd(g)

shapefile.shape(i).Distance(shape)

shapefile.Features[i].Geometry.Distance(shape.Geometry)

shape.Point(0).x

shape.Geometry.Points[0].X

Shape.numPoints

shape.Geometry.Points.Count

shape.length

shape.Geometry.Length

shape.IsValid

shape.Geometry.IsValid

shape.NumParts

shape.Geometry.Parts.Count

shapes(k) (result of SelectShapes)

shapes.ElementAt(k).Index

shapefile.SelectShapes(ext, buf, MapWinGIS.SelectMode.INTERSECTION, oshapes)

IEnumerable<IFeature> shapes = sfPt.SelectShapes(ext, buf, Api.Enums.MapSelectionMode.Intersection);

shapefile.shp.NumShapes

Ilayer.FeatureSet.Features.Count

shapefile.CellValue(codeCh1, i)

shapefile.Features[i].GetValue(codeCh1)

shapefile.EditInsertShape(shap, isPt);

shapefile.Features.EditInsert(shap.Geometry, ref isPt);

shapefileEditCellValue(0, isPt, tabPt[1));

shapefile.Features[isPt].SetValue(0,  tabPt[1])

shapefile.EditAddField

shapefile.Table.Fields.Add

shapefile.projection='projection'

shapefile.AssignProjection('projection')

shapefile.shp.Field(i).Name

shapefile..FeatureSet.Fields[i].Name.

MapWinGIS.FieldType.STRING_FIELD

Api.Enums.AttributeType.String

MapWinGIS.SelectMode.INTERSECTION

Api.Enums.MapSelectionMode.Intersection

MapWinGIS.ShpfileType.SHP_POINT

Api.Enums.GeometryType.Point

MapWinGIS.ShpfileType.SHP_POLYLINE

Api.Enums.GeometryType.Polyline

Last edited Dec 23, 2015 at 2:44 PM by olivier57, version 3