Exemplo n.º 1
0
                 // alternative $index[$sound][$row['ptype']]['pnum'] = $name;
             }
         }
         $blob = clb_blob_enc($index, TRUE);
         //TRUE=binary
         file_put_contents($metaphones, $blob);
         //, FILE_BINARY);
     }
     break;
 case 'near':
     //create mapping from raw segs to nodes
     $stopsegs = pbuild_stop2segs($node_types, $raw_segs, $near_path);
     break;
 case 'prim':
     //build array with end points of raw links so we can build node to node links
     $primitives = pbuild_primitives($raw_segs, $prim_path);
     break;
 case 'links':
     //build ACTUAL node to node link reocrds
     $data = file_get_contents($near_path);
     //, FILE_BINARY);
     $stopsegs = clb_blob_dec($data);
     $data = file_get_contents($prim_path);
     //, FILE_BINARY);
     $primitives = clb_blob_dec($data);
     $query = 'SELECT ' . RF_ROUTES_KEY . ' FROM ' . RF_ROUTES_FROM . ' WHERE ' . $route_where;
     $sel = $wpdb->get_results($query, ARRAY_A);
     $rnums = clb_column($sel, RF_ROUTES_KEY);
     //creates node to node links from the primitive ones
     pbuild_daisychain($rnums, $primitives, $stopsegs);
     break;
Exemplo n.º 2
0
             file_put_contents($path, $blob, FILE_BINARY);
         }
     }
     break;
 case 'near':
     //create mapping from raw segs to nodes
     if (IS_CLI) {
         $map = pbuild_stop2segs($node_types, $raw_segs, $map_path);
     } else {
         $path = $map_path;
     }
     break;
 case 'raw':
     //build array with end points of raw links so we can build node to node links
     if (IS_CLI) {
         $map = pbuild_primitives($raw_segs, $links_path);
     } else {
         $path = $links_path;
     }
     break;
 case 'stops':
     //build array of rnum/pnum stops so we can look up which stops are on which routes
     if (IS_CLI) {
         $sel = do_query('SELECT rnum FROM routes WHERE ' . $route_where, __FILE__, __LINE__, 'rnum');
         $rnums = array_keys($sel);
         $map = pbuild_stops_xref($rnums, $stops_path);
     } else {
         $path = $stops_path;
     }
     break;
 case 'links':