104 |
public List<StationBean> getByLocation(double latitude, double longitude) throws SQLException { |
public List<StationBean> getByLocation(double latitude, double longitude) throws SQLException { |
105 |
String SQL = "SELECT * FROM ( "+ |
String SQL = "SELECT * FROM ( "+ |
106 |
" SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, stationcode_metro, address," + |
" SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, stationcode_metro, address," + |
107 |
" earth_distance( ll_to_earth(latitude,longitude), ll_to_earth(?,?))::int AS calcdist " + |
" earth_distance( earth_coord, ll_to_earth(?,?))::int AS calcdist " + |
108 |
" FROM trainstations " + |
" FROM trainstations " + |
109 |
" WHERE enabled = true " + |
" WHERE enabled = true " + |
110 |
" ) AS trainstations2 " + |
" ) AS trainstations2 " + |