public override void Succes() { // get the last arc and the last point. AggregatedArc latest_arc = (this.FinalMessages[this.FinalMessages.Count - 2] as MicroPlannerMessageArc).Arc; AggregatedPoint latest_point = (this.FinalMessages[this.FinalMessages.Count - 1] as MicroPlannerMessagePoint).Point; // count the number of streets in the same turning direction as the turn // that was found. int count = 0; if (MicroPlannerHelper.IsLeft(latest_point.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetLeft(this.FinalMessages, this.Planner.Interpreter); } else if (MicroPlannerHelper.IsRight(latest_point.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetRight(this.FinalMessages, this.Planner.Interpreter); } // construct the box indicating the location of the resulting find by this machine. GeoCoordinate point1 = latest_point.Location; GeoCoordinateBox box = new GeoCoordinateBox( new GeoCoordinate(point1.Latitude - 0.001f, point1.Longitude - 0.001f), new GeoCoordinate(point1.Latitude + 0.001f, point1.Longitude + 0.001f)); //string next_street = latest_point.Next.Name; // let the scentence planner generate the correct information. this.Planner.SentencePlanner.GenerateRoundabout(box, count - 1, latest_point.Next.Tags); }
public override void Succes() { // get the last arc and the last point. var latestArc = (this.FinalMessages[this.FinalMessages.Count - 2] as MicroPlannerMessageArc).Arc; var latestPoint = (this.FinalMessages[this.FinalMessages.Count - 1] as MicroPlannerMessagePoint).Point; // count the number of streets in the same turning direction as the turn // that was found. int count = 0; if (MicroPlannerHelper.IsLeft(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetLeft(this.FinalMessages, this.Planner.Interpreter); } else if (MicroPlannerHelper.IsRight(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetRight(this.FinalMessages, this.Planner.Interpreter); } // construct the box indicating the location of the resulting find by this machine. var point1 = latestPoint.Location; var box = new GeoCoordinateBox( new GeoCoordinate(point1.Latitude - 0.001f, point1.Longitude - 0.001f), new GeoCoordinate(point1.Latitude + 0.001f, point1.Longitude + 0.001f)); // let the scentence planner generate the correct information. var metaData = new Dictionary <string, object>(); metaData["count"] = count - 1; metaData["street"] = latestPoint.Next.Tags; metaData["pois"] = latestPoint.Points; metaData["type"] = "roundabout"; this.Planner.SentencePlanner.GenerateInstruction(metaData, latestPoint.EntryIdx, box, latestPoint.Points); }
public override void Succes() { // get the last arc and the last point. var latestArc = (this.FinalMessages[this.FinalMessages.Count - 2] as MicroPlannerMessageArc).Arc; var latestPoint = (this.FinalMessages[this.FinalMessages.Count - 1] as MicroPlannerMessagePoint).Point; var secondLatestArc = (this.FinalMessages[this.FinalMessages.Count - 4] as MicroPlannerMessageArc).Arc; var secondLatestPoint = (this.FinalMessages[this.FinalMessages.Count - 3] as MicroPlannerMessagePoint).Point; // count the number of streets in the same turning direction as the turn // that was found. int count = 0; if (MicroPlannerHelper.IsLeft(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetLeft(this.FinalMessages, this.Planner.Interpreter); } else if (MicroPlannerHelper.IsRight(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetRight(this.FinalMessages, this.Planner.Interpreter); } // construct the box indicating the location of the resulting find by this machine. var point1 = latestPoint.Location; var box = new GeoCoordinateBox( new GeoCoordinate(point1.Latitude - 0.001f, point1.Longitude - 0.001f), new GeoCoordinate(point1.Latitude + 0.001f, point1.Longitude + 0.001f)); // get all the names/direction/counts. var nextName = latestPoint.Next.Tags; var betweenName = latestArc.Tags; var beforeName = secondLatestArc.Tags; int firstCount = count; RelativeDirection firstTurn = secondLatestPoint.Angle; RelativeDirection secondTurn = latestPoint.Angle; // let the scentence planner generate the correct information. var metaData = new Dictionary <string, object>(); metaData["first_street"] = beforeName; metaData["first_direction"] = firstTurn; metaData["second_street"] = betweenName; metaData["second_direction"] = secondTurn; metaData["count_before"] = firstCount; metaData["pois"] = latestPoint.Points; metaData["type"] = "immidiate_turn"; this.Planner.SentencePlanner.GenerateInstruction(metaData, latestPoint.EntryIdx, box, latestPoint.Points); }
public override void Succes() { // get the last arc and the last point. AggregatedArc latestArc = (this.FinalMessages[this.FinalMessages.Count - 2] as MicroPlannerMessageArc).Arc; AggregatedPoint latestPoint = (this.FinalMessages[this.FinalMessages.Count - 1] as MicroPlannerMessagePoint).Point; AggregatedArc secondLatestArc = (this.FinalMessages[this.FinalMessages.Count - 4] as MicroPlannerMessageArc).Arc; AggregatedPoint secondLatestPoint = (this.FinalMessages[this.FinalMessages.Count - 3] as MicroPlannerMessagePoint).Point; // count the number of streets in the same turning direction as the turn // that was found. int count = 0; if (MicroPlannerHelper.IsLeft(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetLeft(this.FinalMessages, this.Planner.Interpreter); } else if (MicroPlannerHelper.IsRight(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetRight(this.FinalMessages, this.Planner.Interpreter); } // construct the box indicating the location of the resulting find by this machine. GeoCoordinate point1 = latestPoint.Location; GeoCoordinateBox box = new GeoCoordinateBox( new GeoCoordinate(point1.Latitude - 0.001f, point1.Longitude - 0.001f), new GeoCoordinate(point1.Latitude + 0.001f, point1.Longitude + 0.001f)); // get all the names/direction/counts. TagsCollectionBase nextName = latestPoint.Next.Tags; TagsCollectionBase betweenName = latestArc.Tags; TagsCollectionBase beforeName = secondLatestArc.Tags; int firstCount = count; RelativeDirection firstTurn = secondLatestPoint.Angle; RelativeDirection secondTurn = latestPoint.Angle; // let the scentence planner generate the correct information. this.Planner.SentencePlanner.GenerateImmidiateTurn(latestPoint.EntryIdx, box, beforeName, firstTurn, firstCount, secondTurn, betweenName, nextName, latestPoint.Points); }
public override void Succes() { // get the last arc and the last point. var latestArc = (this.FinalMessages[this.FinalMessages.Count - 2] as MicroPlannerMessageArc).Arc; var latestPoint = (this.FinalMessages[this.FinalMessages.Count - 1] as MicroPlannerMessagePoint).Point; // count the number of streets in the same turning direction as the turn // that was found. int count = 0; if (MicroPlannerHelper.IsLeft(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetLeft(this.FinalMessages, this.Planner.Interpreter); } else if (MicroPlannerHelper.IsRight(latestPoint.Angle.Direction, this.Planner.Interpreter)) { count = MicroPlannerHelper.GetRight(this.FinalMessages, this.Planner.Interpreter); } // construct the box indicating the location of the resulting find by this machine. var point1 = latestPoint.Location; var box = new GeoCoordinateBox( new GeoCoordinate(point1.Latitude - 0.001f, point1.Longitude - 0.001f), new GeoCoordinate(point1.Latitude + 0.001f, point1.Longitude + 0.001f)); // descide what type of instruction to request be generated. var metaData = new Dictionary <string, object>(); var streetFrom = latestArc.Tags; var streetTo = latestPoint.Next.Tags; var streetCountTurn = 0; var streetCountBeforeTurn = count; var direction = latestPoint.Angle; metaData["count_before"] = streetCountBeforeTurn; metaData["direction"] = direction; if (streetFrom == streetTo) { if (streetCountTurn == 0) {// there are no other streets between the one being turned into and the street coming from in the same // direction as the turn. metaData["type"] = "direct_follow_turn"; } else { // there is another street; this is tricky to explain. metaData["type"] = "indirect_follow_turn"; } } else { if (streetCountTurn == 0) { // there are no other streets between the one being turned into and the street coming from in the same // direction as the turn. metaData["type"] = "direct_turn"; } else { // there is another street; this is tricky to explain. metaData["type"] = "indirect_turn"; } } // let the scentence planner generate the correct information. metaData["street"] = streetTo; metaData["pois"] = latestPoint.Points; this.Planner.SentencePlanner.GenerateInstruction(metaData, latestPoint.EntryIdx, box, latestPoint.Points); }