@Override // return true when cdr is in the box public boolean filter(CDR cdr) { Cell initCell = CDRUtil.getCell(cdr.getInitCellID()); Cell finCell = CDRUtil.getCell(cdr.getFinCellID()); return (initCell.isIn(boundingBox) && finCell.isIn(boundingBox)); }
public void setup() { size(1900, 1000, GLConstants.GLGRAPHICS); smooth(); gfx = new ToxiclibsSupport(this); font = createFont("Arial", 30); textFont(font); String line; numbers = new ArrayList<String>(); try { BufferedReader br = new BufferedReader( new FileReader( Constants.RESULT_PATH + File.separator + "11_home_work_lat_long" + File.separator + "home_2_work")); while ((line = br.readLine()) != null) { String[] tokens = line.split("\t"); String number = tokens[0]; numbers.add(number); String home = tokens[1]; num2home.put(number, home); String work = tokens[2]; num2work.put(number, work); } } catch (Exception e) { logger.error("not happend", e); } map = new Map(this, new Google.GoogleMapProvider()); // map = new Map(this, new Microsoft.RoadProvider()); // map = new Map(this, new Yahoo.HybridProvider()); map.zoomAndPanTo(new Location(41.387628f, 2.1698f), 13); // lat-long MapUtils.createDefaultEventDispatcher(this, map); try { BufferedReader br = new BufferedReader(new FileReader(Constants.BARCELONA_CELL_INFO_PATH)); while ((line = br.readLine()) != null) { if (line.startsWith("cell")) continue; // skip the first line of column description Cell cell = new Cell(line); String btsID = cell.getBTSID(); BTS2Location.put( btsID, new Location((float) cell.getLatitude(), (float) cell.getLongitude())); } } catch (IOException e) { logger.error(e); } catch (ParseException e) { logger.error(e); } loadIndividualMarkov(); }