Ejemplo n.º 1
0
     $stops_xref = pbuild_stops_xref($rnums, $stops_path);
     break;
 case 'p2p':
     //build array of node to node links that will be used when finding shortest paths
     $data = file_get_contents($stops_path);
     //, FILE_BINARY);
     $stops_xref = clb_blob_dec($data);
     //the p2p_links list is built based on a selection of routes and links only included if they are on a route
     $p2p_links = pbuild_p2p_links($node_types, $stops_xref, $p2p_path);
     break;
 case 'walk':
     //check for nodes near other nodes and CREATE INTERCHANGE LINKS
     $data = file_get_contents($p2p_path);
     //, FILE_BINARY);
     $p2p_links = clb_blob_dec($data);
     pbuild_walk_links($node_types, $p2p_links);
     break;
 case 'clean':
     global $editor_types, $editor_tables;
     $types = array();
     foreach ($editor_types as $type => $info) {
         if (strlen($type) == 4 && clb_val(FALSE, $info, 'table') == RF_LINKS_FROM) {
             $types[] = $type;
         }
     }
     $query = 'SELECT ' . RF_LINKS_KEY . ',' . RF_LINKS_POINTS . ' FROM ' . RF_LINKS_FROM . ' WHERE ' . RF_LINKS_TYPE . ' IN ' . clb_join($types, TRUE);
     $sel = $wpdb->get_results($query, ARRAY_A);
     $max = clb_count($sel);
     if ($max) {
         foreach ($sel as $i => $rec) {
             if ($i % round($max / 10) == 0) {
Ejemplo n.º 2
0
         //the rp_stops list is built based on a selection of routes and links only included if they are on a route
         $map = pbuild_p2p_links($node_types, $stops_xref, $p2p_path);
     } else {
         $path = $p2p_path;
     }
     break;
 case 'interchange':
     //check for nodes near other nodes and CREATE INTERCHANGE LINKS
     //this requires the p2p file so have to generate it, run this and then rerun the p2p file
     if (IS_CLI) {
         //load list of links so we do not make interchanges on nodes that are already linked
         $data = file_get_contents($p2p_path, FILE_BINARY);
         $links = clb_blob_dec($data);
         //since interchange switches between modes, uses its own list of interchange types
         $ptypes = array('rail', 'tube', 'tram');
         pbuild_walk_links($ptypes, $links);
     } else {
         qpre($mode . ' mode in the CLI generates the interchange "walk" link segments');
     }
     break;
 case 7:
     if (IS_CLI) {
         pbuild_check_ends($ptype);
     } else {
         qpre($mode . ' mode in the CLI check_raw_ends');
     }
     break;
 case 8:
     if (IS_CLI) {
         echo $mode . ' no function for this mode, tests route finder in browser';
     } else {