|
@@ -79,9 +79,19 @@ int RoadSample::SampleRoad(Road * pRoad)
|
|
}
|
|
}
|
|
nSec++;
|
|
nSec++;
|
|
|
|
|
|
|
|
+ fS = sstart_Section;
|
|
while(fS<send_Section)
|
|
while(fS<send_Section)
|
|
{
|
|
{
|
|
-
|
|
|
|
|
|
+ bool bInserPoint = false;
|
|
|
|
+ if(fabs(send_Section - fS)<=fStep)
|
|
|
|
+ {
|
|
|
|
+ fS = send_Section; //If Section End,Same Point
|
|
|
|
+ if(i !=(nLSCount -1))
|
|
|
|
+ {
|
|
|
|
+ fS = send_Section - 0.0000001; //if not the last,set a value small to sample;
|
|
|
|
+ }
|
|
|
|
+ bInserPoint = true;
|
|
|
|
+ }
|
|
double fRefX,fRefY,fRefZ,fRefHdg,fOffsetValue;
|
|
double fRefX,fRefY,fRefZ,fRefHdg,fOffsetValue;
|
|
pRoad->GetGeometryCoords(fS,fRefX,fRefY,fRefHdg);
|
|
pRoad->GetGeometryCoords(fS,fRefX,fRefY,fRefHdg);
|
|
fRefZ = pRoad->GetElevationValue(fS);
|
|
fRefZ = pRoad->GetElevationValue(fS);
|
|
@@ -89,18 +99,9 @@ int RoadSample::SampleRoad(Road * pRoad)
|
|
|
|
|
|
if(fabs(fOffsetValue) > mfMaxLaneOff)mfMaxLaneOff = fabs(fOffsetValue);
|
|
if(fabs(fOffsetValue) > mfMaxLaneOff)mfMaxLaneOff = fabs(fOffsetValue);
|
|
|
|
|
|
- if(fabs(send_Section - fS)<0.1)
|
|
|
|
- {
|
|
|
|
- fS = send_Section; //If Section End,Same Point
|
|
|
|
-// if(i == (nLSCount - 1))
|
|
|
|
-// {
|
|
|
|
-// fS = send_Section;
|
|
|
|
-// }
|
|
|
|
-// else
|
|
|
|
-// {
|
|
|
|
-// fS = send_Section;
|
|
|
|
-// }
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
bool bIsCrossFeature = false;
|
|
bool bIsCrossFeature = false;
|
|
|
|
|
|
@@ -141,7 +142,7 @@ int RoadSample::SampleRoad(Road * pRoad)
|
|
// SampleLanePoint(pRoad,pLS,fS,xvectorLanePoint);
|
|
// SampleLanePoint(pRoad,pLS,fS,xvectorLanePoint);
|
|
|
|
|
|
|
|
|
|
- bool bInserPoint = false;
|
|
|
|
|
|
+
|
|
|
|
|
|
if(bHaveLast == false)
|
|
if(bHaveLast == false)
|
|
{
|
|
{
|
|
@@ -333,7 +334,7 @@ int RoadSample::SampleRoad(Road * pRoad)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // std::vector<RoadPoint> * pvectorRoadPoint = &mvectorRoadPoint;
|
|
|
|
|
|
+ std::vector<RoadPoint> * pvectorRoadPoint = &mvectorRoadPoint;
|
|
|
|
|
|
std::cout<<"Road: "<<mstrroadid<<" max "<<mfRefX_max<<" "<<mfRefY_max<<" min "<<mfRefX_min<<" "<<mfRefY_min<<std::endl;
|
|
std::cout<<"Road: "<<mstrroadid<<" max "<<mfRefX_max<<" "<<mfRefY_max<<" min "<<mfRefX_min<<" "<<mfRefY_min<<std::endl;
|
|
|
|
|
|
@@ -609,7 +610,7 @@ double RoadSample::GetYMin()
|
|
return mfY_min;
|
|
return mfY_min;
|
|
}
|
|
}
|
|
|
|
|
|
-bool RoadSample::PointInRoad(const double x, const double y, double &s,double & t,int & nlane)
|
|
|
|
|
|
+bool RoadSample::PointInRoad(const double x, const double y, double &s,double & t,int & nlane, std::string & strlanetype)
|
|
{
|
|
{
|
|
if((x<mfX_min)||(x>mfX_max))
|
|
if((x<mfX_min)||(x>mfX_max))
|
|
{
|
|
{
|
|
@@ -658,11 +659,14 @@ bool RoadSample::PointInRoad(const double x, const double y, double &s,double &
|
|
if(p1.mvectorLanePoint[j].nLane<=0)
|
|
if(p1.mvectorLanePoint[j].nLane<=0)
|
|
{
|
|
{
|
|
nlane = p1.mvectorLanePoint[j+1].nLane;
|
|
nlane = p1.mvectorLanePoint[j+1].nLane;
|
|
|
|
+ strlanetype = p1.mvectorLanePoint[j+1].mstrLaneType;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
nlane = p1.mvectorLanePoint[j].nLane;
|
|
nlane = p1.mvectorLanePoint[j].nLane;
|
|
|
|
+ strlanetype = p1.mvectorLanePoint[j].mstrLaneType;
|
|
}
|
|
}
|
|
|
|
+
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|