Skip to content
Snippets Groups Projects
Commit b48cbb58 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solvd a bug when computing the the start/end distances when creating junction segments.

parent 70f1beab
No related branches found
No related tags found
1 merge request!2Solved a bug when creating a new geometry object: the sale factor is...
......@@ -627,32 +627,33 @@ void COSMJunction::create_links(void)
{
node1=&in_way.get_segment_end_node(FIRST_SEGMENT);
if((left=in_way.is_node_left(*node3,false,0.2))==true)
in_radius=DEFAULT_MIN_RADIUS-(k-((double)(in_way.get_num_lanes()-1))/2.0)*in_way.get_lane_width();
in_radius=DEFAULT_MIN_RADIUS+((k+1)/2.0)*in_way.get_lane_width();
else if((right=in_way.is_node_right(*node3,false,0.2))==true)
in_radius=DEFAULT_MIN_RADIUS+(k-((double)(in_way.get_num_lanes()-1))/2.0)*in_way.get_lane_width();
in_radius=DEFAULT_MIN_RADIUS+(((double)(in_way.get_num_lanes()-1)-k)/2.0)*in_way.get_lane_width();
}
else
{
node1=&in_way.get_segment_start_node(LAST_SEGMENT);
if((left=in_way.is_node_left(*node3,true,0.2))==true)
in_radius=DEFAULT_MIN_RADIUS+(k-((double)(in_way.get_num_lanes()-1))/2.0)*in_way.get_lane_width();
in_radius=DEFAULT_MIN_RADIUS+(((double)(in_way.get_num_lanes()-1)-k)/2.0)*in_way.get_lane_width();
else if((right=in_way.is_node_right(*node3,true,0.2))==true)
in_radius=DEFAULT_MIN_RADIUS-(k-((double)(in_way.get_num_lanes()-1))/2.0)*in_way.get_lane_width();
in_radius=DEFAULT_MIN_RADIUS+((k+1)/2.0)*in_way.get_lane_width();
}
if(out_way.is_node_first(this->parent_node->get_id()))
{
if(left)
out_radius=DEFAULT_MIN_RADIUS+(l-((double)(out_way.get_num_lanes()-1))/2.0)*out_way.get_lane_width();
out_radius=DEFAULT_MIN_RADIUS+(((double)(out_way.get_num_lanes()-1)-l)/2.0)*out_way.get_lane_width();
else if(right)
out_radius=DEFAULT_MIN_RADIUS-(l-((double)(out_way.get_num_lanes()-1))/2.0)*out_way.get_lane_width();
out_radius=DEFAULT_MIN_RADIUS+((l+1)/2.0)*out_way.get_lane_width();
}
else
{
if(left)
out_radius=DEFAULT_MIN_RADIUS-(l-((double)(out_way.get_num_lanes()-1))/2.0)*out_way.get_lane_width();
out_radius=DEFAULT_MIN_RADIUS+((l+1)/2.0)*out_way.get_lane_width();
else if(right)
out_radius=DEFAULT_MIN_RADIUS+(l-((double)(out_way.get_num_lanes()-1))/2.0)*out_way.get_lane_width();
out_radius=DEFAULT_MIN_RADIUS+(((double)(out_way.get_num_lanes()-1)-l)/2.0)*out_way.get_lane_width();
}
// std::cout << "in way: " << in_way.id << " lane " << k << " out way: " << out_way.id << " lane " << l << " in radius " << in_radius << " out radius " << out_radius << std::endl;
angle=this->parent_node->compute_angle(*node1,*node3);
if(!left && !right)
{
......
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