Esempio n. 1
0
	//Checks for intersections within 50m (expects) Yonge and Davisville
	TEST_FIXTURE(YongeDavisvilleFixture, intersection_50){
		radius = 50;
		points = find_points_within_radius(SmallIntersections, numPts, testPt, radius);

		CHECK_EQUAL (2, numPts);
		CHECK_EQUAL("Davisville Avenue", getIntersectionName(points[0]));
		CHECK_EQUAL("Davisville Avenue", getIntersectionName(points[1]));
	}
Esempio n. 2
0
File: m3.cpp Progetto: chungs31/gis
void Graph::printGraph() {
    for (std::vector<Node>::iterator it = node_vector.begin();
            it != node_vector.end();
            ++it) {
        std::cout << "Node " << (*it).getNodeID() << "(" << getIntersectionName((*it).getNodeID()) << ") is connected to:" << std::endl;
        // PRINT ALL THE NODES
        // ACCESS EDGES AND THEN
        // PRINT ALL THE NODE IDS
        // AND THEIR STREET SEGMENTS IT IS CNONECTED TO

        std::vector<Edge> suc = (*it).getSuccessors();
        for (std::vector<Edge>::iterator it2 = suc.begin();
                it2 != suc.end();
                ++it2 ) {
            std::cout << (*it2).getnodeID() << "(" << getIntersectionName((*it2).getnodeID()) << ") by street segment " << (*it2).getPath_Streetseg() << std::endl;
        }
    }
}
Esempio n. 3
0
t_point Search(string destination) {
    int tempID = keywordSearchIntersections(destination);
    if (tempID >= 0) {
        update_message(getIntersectionName(tempID));
        return LatLontoCoordinate(getIntersectionPosition(tempID));
    }
    else {
        update_message("No such street intersection(s)");
        return t_point(-1, -1);
    }
}
Esempio n. 4
0
void LoadIntersectionNames() {
    for (unsigned i = 0; i < getNumberOfIntersections(); i++) {
        stringstream intersection_name;
        intersection_name << IntersectionNameFilter(getIntersectionName(i));
        string street_name;
        vector<string> key;
        while (!intersection_name.fail()) {
            intersection_name >> street_name;
            //to be completed
        }
    }
}