|
5 | 5 | public class Main { |
6 | 6 | public static void main(String[] args) throws EmptyUrlException { |
7 | 7 |
|
8 | | - OSRMClient client = new OSRMClient("http://localhost:8080"); |
9 | | - List <GeoLocation> locations = new ArrayList<>(); |
| 8 | + try { |
| 9 | + OSRMClient client = new OSRMClient("http://localhost:8008"); |
| 10 | + List<GeoLocation> locations = new ArrayList<>(); |
10 | 11 |
|
11 | | - GeoLocation geo1 = new GeoLocation(-33.416943, -70.60952); |
12 | | - GeoLocation geo2 = new GeoLocation(-33.416943, -70.60952); |
13 | | - GeoLocation geo3 = new GeoLocation(-33.4445755, -70.6404943); |
14 | | - GeoLocation geo4 = new GeoLocation(-33.4457167, -70.61926449999999); |
| 12 | + GeoLocation geo1 = new GeoLocation(-33.416943, -70.60952); |
| 13 | + GeoLocation geo2 = new GeoLocation(-33.416943, -70.60952); |
| 14 | + GeoLocation geo3 = new GeoLocation(-33.4445755, -70.6404943); |
| 15 | + GeoLocation geo4 = new GeoLocation(-33.4457167, -70.61926449999999); |
15 | 16 |
|
16 | | - locations.add(geo1); |
17 | | - locations.add(geo2); |
18 | | - locations.add(geo3); |
19 | | - locations.add(geo4); |
| 17 | + locations.add(geo1); |
| 18 | + locations.add(geo2); |
| 19 | + locations.add(geo3); |
| 20 | + locations.add(geo4); |
20 | 21 |
|
21 | | - // low fmv |
22 | | - double speedRate = 2; |
23 | | - String country = "CL"; |
| 22 | + // low fmv |
| 23 | + double speedRate = 2; |
| 24 | + String country = "CL"; |
24 | 25 |
|
25 | | - // token |
26 | | - String token = "None"; |
| 26 | + // token |
| 27 | + String token = "None"; |
27 | 28 |
|
28 | | - String profile = "car"; |
| 29 | + String profile = "car"; |
29 | 30 |
|
30 | | - OSRMDistanceResponse response = client.getDistanceMatrix(locations, speedRate, country, token, profile, null); |
| 31 | + OSRMDistanceResponse response = client.getDistanceMatrix(locations, speedRate, country, token, profile, |
| 32 | + null); |
31 | 33 |
|
32 | | - System.out.println(response); |
| 34 | + System.out.println(response); |
| 35 | + }catch (Exception e){ |
| 36 | + e.printStackTrace(); |
| 37 | + System.out.println("End with errors."); |
| 38 | + } |
33 | 39 | } |
34 | 40 | } |
0 commit comments