Skip to content

Commit c33aede

Browse files
committed
Update map-matching documentation to include match command
1 parent e9a2f9b commit c33aede

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

map-matching/README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,24 @@ See the demo in action (black is GPS track, green is matched result):
1111

1212
### Web app
1313

14-
To install GraphHopper see [these instructions](../README.md#installation). After the import process finished you can access a simple map matching UI via `http://localhost:8989/maps/map-matching/` (including the trailing slash).
14+
To install GraphHopper and start the GraphHopper server see [these instructions](../README.md#installation). After the import process finished you can access a simple map matching UI via `http://localhost:8989/maps/map-matching/` (including the trailing slash). Note that for map-matching you need a version 3.0 or higher so you probably need to build from source currently.
1515

1616
You can post GPX files and get back snapped results as GPX or as JSON. An example curl request is:
1717
```bash
18-
curl -XPOST -H "Content-Type: application/gpx+xml" -d @web/src/test/resources/test1.gpx "localhost:8989/match?vehicle=car&type=json"
18+
curl -XPOST -H "Content-Type: application/gpx+xml" -d @web/src/test/resources/test1.gpx "localhost:8989/match?profile=car&type=json"
1919
```
2020

21-
#### Java usage
21+
### CLI usage
22+
23+
You can also use map-matching via the command line without running the GraphHopper server. The usage is very similar to the GraphHopper server. You need a configuration file and running the `match` command will either use existing GraphHopper files or trigger a new import. Use the `match` command like this for example:
24+
25+
```bash
26+
java -jar graphhopper-web-3.0-SNAPSHOT.jar match --file config.yml --profile car web/src/test/resources/*.gpx
27+
```
28+
29+
where the argument after `-jar` is the GraphHopper jar that you need to build from source or download (3.0 or higher). The profile is chosen via the `--profile` option and the GPX files are specified after the last option. In the above example we use all GPX files found in the test resources.
30+
31+
### Java usage
2232

2333
Have a look at `MapMatchingResource.java` to see how the web service is implemented on top
2434
of library functions to get an idea how to use map matching in your own project.

0 commit comments

Comments
 (0)