Esempio n. 1
0
    }
} else {
    if ($_GET['type'] == 's2s') {
        // get starting point
        $start_marker = $markers[$_GET['start']];
        if ($debug) {
            $start_marker->printInfo();
        }
        // get ending point
        $end_marker = $markers[$_GET['end']];
        if ($debug) {
            $end_marker->printInfo();
        }
        // log
        if ($logging) {
            logS2SQuery($_GET['start'], $_GET['end']);
        }
        // find the path
        $path = findS2SPath($start_marker, $end_marker);
    } else {
        if ($_GET['type'] == 'dir') {
            // get locations for end address
            $saddr = $_GET['saddr'];
            // check for boston and ma
            $saddr = checkString($saddr, $city);
            $saddr = checkString($saddr, $state);
            $starts = getLocations($saddr);
            // get locations for start address
            $daddr = $_GET['daddr'];
            // check for boston and ma
            $daddr = checkString($daddr, $city);
Esempio n. 2
0
            $start_stations = findNearestStations2($start_location);
            // find three closest ending stations
            $end_stations = findNearestStations2($end_location);
            $path = findDirTimePath($start_location, $end_location, $start_stations, $end_stations, $time);
        }
    }
} else {
    if ($type == "s2s") {
        // S2S
        // get starting point
        //$start_marker = getMarker($sid);
        // get ending point
        //$end_marker = getMarker($did);
        // log
        if ($logging) {
            logS2SQuery($sid, $did);
        }
        // testing new function
        echo "***testing new algorithm<br/>\n";
        //$start_station = retrieveStation($start_marker->id);
        //$end_station = retrieveStation($end_marker->id);
        $start_station = retrieveStation($sid);
        $end_station = retrieveStation($did);
        $pathArray = algorithm($start_station, $end_station);
        $path = $pathArray[0];
        echo "*** end testing new algorithm<br/>\n";
        // find the path
        //$path = findS2SPath($start_marker, $end_marker);
    } else {
        if ($type == "location") {
            // location