Пример #1
0
 def testCommutePopRoute(self):
     points = visualize.Commute_pop_route(5, self.weekago, self.now)
     # There are 5 sections with mode = 5 in the test data.
     # We add 20 points to each section
     # Then, we strip out the first 5 and last 5 points
     # So each section contributes 10 points to this
     # So we expect a total of 50 points
     self.assertEquals(len(points['latlng']), 50)
Пример #2
0
def getCommutePopRoute(selMode):
  mode = get_mode_db().find_one({'mode_name': selMode})
  fromTs = request.query.from_ts
  toTs = request.query.to_ts
  logging.debug("Filtering values for range %s -> %s" % (fromTs, toTs))
  retVal = visualize.Commute_pop_route(mode['mode_id'],
    datetime.fromtimestamp(float(fromTs)/1000), datetime.fromtimestamp(float(toTs)/1000))
  # retVal = common.generateRandomResult(['00-04', '04-08', '08-10'])
  # logging.debug("In getCalPopRoute, retVal is %s" % retVal)
  return retVal