10 |
import java.util.logging.Logger; |
import java.util.logging.Logger; |
11 |
|
|
12 |
public class StationDAO { |
public class StationDAO { |
13 |
final static int LOCATION_LIMIT = 5; |
final static int LOCATION_LIMIT = 8; |
14 |
static final Logger logger = Logger.getLogger(StationDAO.class.getName()); |
static final Logger logger = Logger.getLogger(StationDAO.class.getName()); |
15 |
|
|
16 |
|
|
116 |
|
|
117 |
public List<StationBean> getByLocationWorker(double latitude, double longitude, boolean geolimit) throws SQLException { |
public List<StationBean> getByLocationWorker(double latitude, double longitude, boolean geolimit) throws SQLException { |
118 |
|
|
119 |
String limitExpression = geolimit == true ? "AND abs(latitude-?)<0.4 AND abs(longitude-?)<0.75 " : ""; |
String limitExpression = (geolimit == true) ? "AND abs(latitude-?)<0.4 AND abs(longitude-?)<0.75 " : ""; |
120 |
|
|
121 |
String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, stationcode_metro, address, " + |
String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, stationcode_metro, address, " + |
122 |
"earth_distance( earth_coord, ll_to_earth(?,?))::int AS calcdist " + |
"earth_distance( earth_coord, ll_to_earth(?,?))::int AS calcdist " + |