explicitly give the locations of all via locations in response

This commit is contained in:
Dennis Luxen
2013-12-12 18:35:23 -05:00
parent 58dc98460b
commit d0b5929a9e
12 changed files with 363 additions and 345 deletions
-2
View File
@@ -68,7 +68,6 @@ public:
}
reply.status = http::Reply::ok;
reply.content.push_back ("{");
reply.content.push_back ("\"version\":0.3,");
if(
!facade->LocateClosestEndPointForCoordinate(
routeParameters.coordinates[0],
@@ -90,7 +89,6 @@ public:
reply.content.push_back(tmp);
reply.content.push_back("]");
}
reply.content.push_back(",\"transactionId\": \"OSRM Routing Engine JSON Locate (v0.3)\"");
reply.content.push_back("}");
reply.headers.resize(3);
if(!routeParameters.jsonpParameter.empty()) {
-2
View File
@@ -76,7 +76,6 @@ public:
reply.status = http::Reply::ok;
reply.content.push_back("{");
reply.content.push_back("\"version\":0.3,");
reply.content.push_back("\"status\":");
if(UINT_MAX != result.edgeBasedNode) {
reply.content.push_back("0,");
@@ -99,7 +98,6 @@ public:
reply.content.push_back(temp_string);
}
reply.content.push_back("\"");
reply.content.push_back(",\"transactionId\":\"OSRM Routing Engine JSON Nearest (v0.3)\"");
reply.content.push_back("}");
reply.headers.resize(3);
if( !routeParameters.jsonpParameter.empty() ) {
-2
View File
@@ -48,13 +48,11 @@ public:
reply.status = http::Reply::ok;
reply.content.push_back("{");
reply.content.push_back("\"version\":0.3,");
reply.content.push_back("\"status\":");
reply.content.push_back("0,");
reply.content.push_back("\"timestamp\":\"");
reply.content.push_back(facade->GetTimestamp());
reply.content.push_back("\"");
reply.content.push_back(",\"transactionId\":\"OSRM Routing Engine JSON timestamp (v0.3)\"");
reply.content.push_back("}");
reply.headers.resize(3);
if("" != routeParameters.jsonpParameter) {
+4 -3
View File
@@ -83,7 +83,7 @@ public:
RawRouteData rawRoute;
rawRoute.checkSum = facade->GetCheckSum();
bool checksumOK = (routeParameters.checkSum == rawRoute.checkSum);
const bool checksumOK = (routeParameters.checkSum == rawRoute.checkSum);
std::vector<std::string> textCoord;
for(unsigned i = 0; i < routeParameters.coordinates.size(); ++i) {
if( !checkCoord(routeParameters.coordinates[i]) ) {
@@ -110,12 +110,13 @@ public:
);
}
PhantomNodes segmentPhantomNodes;
for(unsigned i = 0; i < phantomNodeVector.size()-1; ++i) {
PhantomNodes segmentPhantomNodes;
segmentPhantomNodes.startPhantom = phantomNodeVector[i];
segmentPhantomNodes.targetPhantom = phantomNodeVector[i+1];
rawRoute.segmentEndCoordinates.push_back(segmentPhantomNodes);
}
if(
( routeParameters.alternateRoute ) &&
(1 == rawRoute.segmentEndCoordinates.size())
@@ -175,7 +176,7 @@ public:
phantomNodes.targetPhantom = rawRoute.segmentEndCoordinates[rawRoute.segmentEndCoordinates.size()-1].targetPhantom;
desc->SetConfig(descriptorConfig);
desc->Run(reply, rawRoute, phantomNodes, facade);
desc->Run(rawRoute, phantomNodes, facade, reply);
if("" != routeParameters.jsonpParameter) {
reply.content.push_back(")\n");
}