39 |
try { |
try { |
40 |
String txtResponse = HttpUtil.getContentString(sb.toString(), 500, "UTF-8"); |
String txtResponse = HttpUtil.getContentString(sb.toString(), 500, "UTF-8"); |
41 |
OSRMDistanceTable table = gson.fromJson(txtResponse, OSRMDistanceTable.class); |
OSRMDistanceTable table = gson.fromJson(txtResponse, OSRMDistanceTable.class); |
42 |
|
if (table.status != 0) { |
43 |
|
logger.info("OSRM failed with message: " + table.status_message); |
44 |
|
return null; |
45 |
|
} |
46 |
|
|
47 |
int bedsteTid = Integer.MAX_VALUE; |
int bedsteTid = Integer.MAX_VALUE; |
48 |
|
|
49 |
for (int i = 1; i<table.distance_table.length; i++) { |
for (int i = 1; i<table.distance_table.length; i++) { |
71 |
*/ |
*/ |
72 |
@Deprecated |
@Deprecated |
73 |
public Adresse getNearest(Adresse a1, Collection<Adresse> haystack) { |
public Adresse getNearest(Adresse a1, Collection<Adresse> haystack) { |
74 |
int bedsteAfstand = 9999999; |
int bedsteAfstand = Integer.MAX_VALUE; |
75 |
Adresse bedsteAdresse = null; |
Adresse bedsteAdresse = null; |
76 |
|
|
77 |
Iterator<Adresse> it = haystack.iterator(); |
Iterator<Adresse> it = haystack.iterator(); |