19 |
|
|
20 |
Gson gson = new Gson(); |
Gson gson = new Gson(); |
21 |
|
|
22 |
final int port = 5000; |
final static int PORT = 5000; |
23 |
final String base_url = "http://" + ServiceConfig.getInstance().osrmHost + ":" + port; |
final String base_url = "http://" + ServiceConfig.getInstance().osrmHost + ":" + PORT; |
24 |
|
|
25 |
|
|
26 |
public Address getNearestTableHttp(Address a1, Collection<Address> haystack) throws Exception { |
public Address getNearestTableHttp(Address a1, Collection<Address> haystack) throws Exception { |
42 |
|
|
43 |
try { |
try { |
44 |
|
|
45 |
String txtResponse = HttpUtil.getContentString(sb.toString(), 750, "UTF-8"); |
String txtResponse = HttpUtil.getContentString(sb.toString(), 1000, "UTF-8"); |
46 |
|
|
47 |
OSRMDistanceTable table = gson.fromJson(txtResponse, OSRMDistanceTable.class); |
OSRMDistanceTable table = gson.fromJson(txtResponse, OSRMDistanceTable.class); |
48 |
|
|