I can show an example of how to get the shape from a street Layer (a shapefile) and also how to get the end points that are candidates for being intersection points. As you can see in the screenshot, we get the two end points of the street when only one is an intersection point. We will have the full logic for that implemented in the Geocoder product but for now I think that you can get something going with what I show you.
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-97.7487,30.274,-97.7343,30.2658);
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.FromArgb(255, 198, 255, 255));
ShapeFileFeatureLayer streetLayer = new ShapeFileFeatureLayer(@"..\..\Data\austinstreets.shp");
streetLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.LocalRoad2;
streetLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("StreetLayer", streetLayer);
winformsMap1.Overlays.Add(staticOverlay);
streetLayer.Open();
Collection<Feature> features = streetLayer.FeatureSource.GetFeaturesByColumnValue("RECID", "12503");
streetLayer.Close();
MultilineShape multiLineShape = features[0].GetShape() as MultilineShape;
InMemoryFeatureLayer streetInMemoryFeatureLayer = new InMemoryFeatureLayer();
streetInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GeoColor.StandardColors.LightPink, 3,true);
streetInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.CreateSimplePointStyle(PointSymbolType.Circle, GeoColor.StandardColors.Red, 12);
streetInMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
streetInMemoryFeatureLayer.Open();
streetInMemoryFeatureLayer.EditTools.BeginTransaction();
streetInMemoryFeatureLayer.EditTools.Add(new Feature(multiLineShape));
streetInMemoryFeatureLayer.EditTools.Add(new Feature(GetEndPoints(multiLineShape)));
streetInMemoryFeatureLayer.EditTools.CommitTransaction();
streetInMemoryFeatureLayer.Close();
LayerOverlay intersectionOverlay = new LayerOverlay();
intersectionOverlay.Layers.Add("Street", streetInMemoryFeatureLayer);
winformsMap1.Overlays.Add(intersectionOverlay);
winformsMap1.Refresh();
private MultipointShape GetEndPoints(MultilineShape multilineShape)
{
MultipointShape multipointShape = new MultipointShape();
foreach (LineShape lineShape in multilineShape.Lines)
{
multipointShape.Points.Add(new PointShape(lineShape.Vertices[0]));
multipointShape.Points.Add(new PointShape(lineShape.Vertices[lineShape.Vertices.Count -1]));
}
return multipointShape;
}