|
@@ -1442,6 +1442,7 @@ std::vector<pathsection> xodrdijkstra::getgpspoint(int srcroadid, int nsrclr, in
|
|
xps.msectionid = mroadedge[xvectorpath[i]].mnsectionid;
|
|
xps.msectionid = mroadedge[xvectorpath[i]].mnsectionid;
|
|
xps.mnroadedgeid = xvectorpath[i];
|
|
xps.mnroadedgeid = xvectorpath[i];
|
|
xps.mpRoad = pRoad;
|
|
xps.mpRoad = pRoad;
|
|
|
|
+ xps.secondsel = xps.mainsel;
|
|
xpathsection.push_back(xps);
|
|
xpathsection.push_back(xps);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1456,60 +1457,101 @@ std::vector<pathsection> xodrdijkstra::getgpspoint(int srcroadid, int nsrclr, in
|
|
Lane * pLane2 = xodrfunc::GetLaneByID(pLS2,xpathsection[i-1].mainsel);
|
|
Lane * pLane2 = xodrfunc::GetLaneByID(pLS2,xpathsection[i-1].mainsel);
|
|
|
|
|
|
int nlr = mroadedge[xvectorpath[i]].mnleftright;
|
|
int nlr = mroadedge[xvectorpath[i]].mnleftright;
|
|
|
|
+ int nlr2 = mroadedge[xvectorpath[i-1]].mnleftright;
|
|
|
|
|
|
bool bNeedChangeLane = true;
|
|
bool bNeedChangeLane = true;
|
|
if(nlr == 2)
|
|
if(nlr == 2)
|
|
{
|
|
{
|
|
- if(pLane2->IsSuccessorSet())
|
|
|
|
- {
|
|
|
|
- if(pLane2->GetSuccessor() != xpathsection[i].mainsel)
|
|
|
|
|
|
+
|
|
|
|
+ if((pLane2->IsSuccessorSet()) &&(nlr2 == 2))
|
|
{
|
|
{
|
|
- bool bfindgood = false;
|
|
|
|
- int ngoodlane = 0;
|
|
|
|
- int j;
|
|
|
|
- for(j=0;j<pLS2->GetLaneCount();j++)
|
|
|
|
|
|
+ if(pLane2->GetSuccessor() != xpathsection[i].mainsel)
|
|
{
|
|
{
|
|
- if(pLS2->GetLane(j)->IsSuccessorSet())
|
|
|
|
|
|
+ bool bfindgood = false;
|
|
|
|
+ int ngoodlane = 0;
|
|
|
|
+ int j;
|
|
|
|
+ for(j=0;j<pLS2->GetLaneCount();j++)
|
|
{
|
|
{
|
|
- if(pLS2->GetLane(j)->GetSuccessor() == xpathsection[i].mainsel)
|
|
|
|
|
|
+ if(pLS2->GetLane(j)->IsSuccessorSet())
|
|
{
|
|
{
|
|
- ngoodlane = pLS2->GetLane(j)->GetId();
|
|
|
|
- bfindgood = true;
|
|
|
|
- break;
|
|
|
|
|
|
+ if(pLS2->GetLane(j)->GetSuccessor() == xpathsection[i].mainsel)
|
|
|
|
+ {
|
|
|
|
+ ngoodlane = pLS2->GetLane(j)->GetId();
|
|
|
|
+ bfindgood = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(bfindgood)
|
|
|
|
+ {
|
|
|
|
+ xpathsection[i-1].mainsel = ngoodlane;
|
|
|
|
+ xpathsection[i-1].mnStartLaneSel = ngoodlane;
|
|
|
|
+ xpathsection[i-1].mnEndLaneSel = ngoodlane;
|
|
|
|
+ bNeedChangeLane = false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
- if(bfindgood)
|
|
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- xpathsection[i-1].mainsel = ngoodlane;
|
|
|
|
- xpathsection[i-1].mnStartLaneSel = ngoodlane;
|
|
|
|
- xpathsection[i-1].mnEndLaneSel = ngoodlane;
|
|
|
|
bNeedChangeLane = false;
|
|
bNeedChangeLane = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- bNeedChangeLane = false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- if(pLane->IsPredecessorSet())
|
|
|
|
- {
|
|
|
|
- if(pLane->GetPredecessor() != xpathsection[i-1].mainsel)
|
|
|
|
|
|
+ if((pLane2->IsPredecessorSet()) &&(nlr2 == 1))
|
|
{
|
|
{
|
|
- xpathsection[i-1].mainsel = pLane->GetPredecessor();
|
|
|
|
- xpathsection[i-1].mnStartLaneSel = pLane->GetPredecessor();
|
|
|
|
- xpathsection[i-1].mnEndLaneSel = pLane->GetPredecessor();
|
|
|
|
- bNeedChangeLane = false;
|
|
|
|
|
|
+ if(pLane2->GetPredecessor() != xpathsection[i].mainsel)
|
|
|
|
+ {
|
|
|
|
+ bool bfindgood = false;
|
|
|
|
+ int ngoodlane = 0;
|
|
|
|
+ int j;
|
|
|
|
+ for(j=0;j<pLS2->GetLaneCount();j++)
|
|
|
|
+ {
|
|
|
|
+ if(pLS2->GetLane(j)->IsPredecessorSet())
|
|
|
|
+ {
|
|
|
|
+ if(pLS2->GetLane(j)->GetPredecessor() == xpathsection[i].mainsel)
|
|
|
|
+ {
|
|
|
|
+ ngoodlane = pLS2->GetLane(j)->GetId();
|
|
|
|
+ bfindgood = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(bfindgood)
|
|
|
|
+ {
|
|
|
|
+ xpathsection[i-1].mainsel = ngoodlane;
|
|
|
|
+ xpathsection[i-1].mnStartLaneSel = ngoodlane;
|
|
|
|
+ xpathsection[i-1].mnEndLaneSel = ngoodlane;
|
|
|
|
+ bNeedChangeLane = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bNeedChangeLane = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if(pLane->IsPredecessorSet())
|
|
|
|
+ {
|
|
|
|
+ if(pLane->GetPredecessor() != xpathsection[i-1].mainsel)
|
|
|
|
+ {
|
|
|
|
+ xpathsection[i-1].mainsel = pLane->GetPredecessor();
|
|
|
|
+ xpathsection[i-1].mnStartLaneSel = pLane->GetPredecessor();
|
|
|
|
+ xpathsection[i-1].mnEndLaneSel = pLane->GetPredecessor();
|
|
|
|
+ bNeedChangeLane = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if(pLane2->IsPredecessorSet())
|
|
|
|
|
|
+ if((pLane2->IsPredecessorSet())&&(nlr2 == 1))
|
|
{
|
|
{
|
|
if(pLane2->GetPredecessor() != xpathsection[i].mainsel)
|
|
if(pLane2->GetPredecessor() != xpathsection[i].mainsel)
|
|
{
|
|
{
|
|
@@ -1543,16 +1585,52 @@ std::vector<pathsection> xodrdijkstra::getgpspoint(int srcroadid, int nsrclr, in
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- if(pLane->IsSuccessorSet())
|
|
|
|
|
|
+ if((pLane2->IsSuccessorSet())&&(nlr2 == 2))
|
|
|
|
+
|
|
{
|
|
{
|
|
- if(pLane->GetSuccessor() != xpathsection[i-1].mainsel)
|
|
|
|
|
|
+ if(pLane2->GetSuccessor() != xpathsection[i].mainsel)
|
|
|
|
+ {
|
|
|
|
+ bool bfindgood = false;
|
|
|
|
+ int ngoodlane = 0;
|
|
|
|
+ int j;
|
|
|
|
+ for(j=0;j<pLS2->GetLaneCount();j++)
|
|
|
|
+ {
|
|
|
|
+ if(pLS2->GetLane(j)->IsSuccessorSet())
|
|
|
|
+ {
|
|
|
|
+ if(pLS2->GetLane(j)->GetSuccessor() == xpathsection[i].mainsel)
|
|
|
|
+ {
|
|
|
|
+ ngoodlane = pLS2->GetLane(j)->GetId();
|
|
|
|
+ bfindgood = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(bfindgood)
|
|
|
|
+ {
|
|
|
|
+ xpathsection[i-1].mainsel = ngoodlane;
|
|
|
|
+ xpathsection[i-1].mnStartLaneSel = ngoodlane;
|
|
|
|
+ xpathsection[i-1].mnEndLaneSel = ngoodlane;
|
|
|
|
+ bNeedChangeLane = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
{
|
|
{
|
|
- xpathsection[i-1].mainsel = pLane->GetSuccessor();
|
|
|
|
- xpathsection[i-1].mnStartLaneSel = pLane->GetSuccessor();
|
|
|
|
- xpathsection[i-1].mnEndLaneSel = pLane->GetSuccessor();
|
|
|
|
bNeedChangeLane = false;
|
|
bNeedChangeLane = false;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if(pLane->IsSuccessorSet())
|
|
|
|
+ {
|
|
|
|
+ if(pLane->GetSuccessor() != xpathsection[i-1].mainsel)
|
|
|
|
+ {
|
|
|
|
+ xpathsection[i-1].mainsel = pLane->GetSuccessor();
|
|
|
|
+ xpathsection[i-1].mnStartLaneSel = pLane->GetSuccessor();
|
|
|
|
+ xpathsection[i-1].mnEndLaneSel = pLane->GetSuccessor();
|
|
|
|
+ bNeedChangeLane = false;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|