public static int mapToGridCell(float lon,float lat){
  int xIndex=(int)Math.floor((Math.abs(LON_WEST) - Math.abs(lon)) / DELTA_LON);
  int yIndex=(int)Math.floor((LAT_NORTH - lat) / DELTA_LAT);
  return xIndex + (yIndex * NUMBER_OF_GRID_X);
}

public static int mapToGridCell ( float lon , float lat ) { int xIndex = ( int ) Math . floor ( ( Math . abs ( LON_WEST ) - Math . abs ( lon ) ) / DELTA_LON ) ; int yIndex = ( int ) Math . floor ( ( LAT_NORTH - lat ) / DELTA_LAT ) ; return xIndex + ( yIndex * NUMBER_OF_GRID_X ) ; }
maps a location specified by latitude and longitude values to a cell of a grid covering the area of nyc . the grid cells are roughly 100 x 100 m and sequentially number from north - west to south - east starting by zero .
