16 |
Random r = new Random(); |
Random r = new Random(); |
17 |
|
|
18 |
//South-West corner= 54.5, 8.0 |
//South-West corner= 54.5, 8.0 |
19 |
//North-East corner= 58.0, 13.0 |
//North-East corner= 57.8, 12.7 |
20 |
//Latitude span=3.5 |
//Latitude span=3.3 |
21 |
//Longitude span=5.0 |
//Longitude span=4.7 |
22 |
void testFindNearest(int count) throws SQLException { |
void testFindNearest(int count) throws SQLException { |
23 |
|
|
24 |
StationDAO db = new StationDAO(); |
StationDAO db = new StationDAO(); |
25 |
|
|
26 |
|
|
27 |
for (int i=0; i<count; i++) { |
for (int i=0; i<count; i++) { |
28 |
float lat = (r.nextFloat()*3.5F) + 54.5F; |
float lat = (r.nextFloat()*3.3F) + 54.5F; |
29 |
float lng = (r.nextFloat()*5.0F) + 8.0F; |
float lng = (r.nextFloat()*4.7F) + 8.0F; |
30 |
db.getByLocation(lat, lng); |
db.getByLocation(lat, lng); |
31 |
} |
} |
32 |
|
|
73 |
} |
} |
74 |
|
|
75 |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
76 |
|
|
77 |
|
|
78 |
String test = request.getParameter("test"); |
String test = request.getParameter("test"); |
79 |
String strCount = request.getParameter("count"); |
String strCount = request.getParameter("count"); |