27 |
import dk.daoas.fulddaekning.Adresse; |
import dk.daoas.fulddaekning.Adresse; |
28 |
import dk.daoas.fulddaekning.HttpUtil; |
import dk.daoas.fulddaekning.HttpUtil; |
29 |
|
|
30 |
|
/* |
31 |
import dk.thoerup.osrmbinding.OSRMBinding; |
import dk.thoerup.osrmbinding.OSRMBinding; |
32 |
import dk.thoerup.osrmbinding.ViarouteResult; |
import dk.thoerup.osrmbinding.ViarouteResult; |
33 |
|
*/ |
34 |
|
|
35 |
public class OSRMHelper { |
public class OSRMHelper { |
36 |
|
|
37 |
|
private static final boolean ENABLE_OSRM = false; |
38 |
|
|
39 |
|
|
40 |
final static Logger logger = Logger.getLogger( OSRMHelper.class.toString() ); |
final static Logger logger = Logger.getLogger( OSRMHelper.class.toString() ); |
41 |
|
|
42 |
Gson gson = new Gson(); |
Gson gson = new Gson(); |
43 |
|
|
44 |
static OSRMBinding binding = null; |
//static OSRMBinding binding = null; |
45 |
|
|
46 |
final String host = "127.0.0.1"; |
final String host = "127.0.0.1"; |
47 |
final int port = 5000; |
final int port = 5000; |
48 |
final String base_url = "http://" + host + ":" + port; |
final String base_url = "http://" + host + ":" + port; |
49 |
|
/* |
50 |
private static synchronized void initOsrm() { |
private static synchronized void initOsrm() { |
51 |
if (binding == null) { |
if (binding == null) { |
52 |
binding = new OSRMBinding("/home/openstreetmap/denmark-latest.osrm"); |
binding = new OSRMBinding("/home/openstreetmap/denmark-latest.osrm"); |
53 |
} |
} |
54 |
} |
} |
55 |
|
*/ |
56 |
|
|
57 |
public Adresse getNearestTableHttp(Adresse a1, Collection<Adresse> haystack) { |
public Adresse getNearestTableHttp(Adresse a1, Collection<Adresse> haystack) { |
58 |
|
|
98 |
|
|
99 |
return bedsteAdresse; |
return bedsteAdresse; |
100 |
} |
} |
101 |
|
/* |
102 |
public Adresse getNearestTableJni(Adresse a1, Collection<Adresse> haystack) { |
public Adresse getNearestTableJni(Adresse a1, Collection<Adresse> haystack) { |
103 |
if (binding == null) { |
if (binding == null) { |
104 |
initOsrm(); |
initOsrm(); |
138 |
} |
} |
139 |
|
|
140 |
return bedsteAdresse; |
return bedsteAdresse; |
141 |
} |
}*/ |
142 |
|
|
143 |
public Adresse getNearestViarouteHttp(Adresse a1, Collection<Adresse> haystack) { |
public Adresse getNearestViarouteHttp(Adresse a1, Collection<Adresse> haystack) { |
144 |
int bedsteAfstand = Integer.MAX_VALUE; |
int bedsteAfstand = Integer.MAX_VALUE; |
205 |
return bedsteAdresse; |
return bedsteAdresse; |
206 |
} |
} |
207 |
|
|
208 |
|
/* |
209 |
public Adresse getNearestViarouteJni(Adresse a1, Collection<Adresse> haystack) { |
public Adresse getNearestViarouteJni(Adresse a1, Collection<Adresse> haystack) { |
210 |
|
|
211 |
if (binding == null) { |
if (binding == null) { |
244 |
} |
} |
245 |
|
|
246 |
return bedsteAdresse; |
return bedsteAdresse; |
247 |
} |
}*/ |
248 |
} |
} |
249 |
|
|
250 |
|
|