GPS Points snap to road positions?

I have installed graphhopper, imported UK route.

The last line at linux console says:

2017-01-26 16:10:20,552 [main] INFO com.graphhopper.http.GHServer - Started server at HTTP :8989

Here’s the thing. I installed graphhopper on same box as LAMP for PHP use.

From PHP I want to send my GPS raw point data and get the nearest point on a road to draw polyline client side.

I have been thinking about using a localhost json wget from PHP or get_file_contents(…).

Data like:

[[-2.252132,52.382972],[-2.25229,52.382945],[-2.252133,52.382957],[-2.25206,52.382913],[-2.252308,52.38268], … ]

1). Could you guide me to a URL on how I should format the requests?

2). Can I submit say 100 raw GPS points in single request and get 100 points, adjusted back again? Do they have to be part of the same trip/journey. I would rather simply have the nearest road point and forget about routes and trips.

I want to snap my raw points to nearest road. I tried google maps api but limited requests causes failure.


You can use the /nearest endpoint which just takes a point=lat,lon parameter.

Thanks, that seems to work. Which is good.


I tried multiple, single points on one request to minimize server usage, like:


but no good.

Multiple points are not implemented. Maybe you create a pull request for this feature? It shouldn’t be that much to change :slight_smile: