T
T
Timur Evgazhukov2020-12-24 10:06:00
Geolocation
Timur Evgazhukov, 2020-12-24 10:06:00

How to draw a point to a line on the map?

There are coordinates of the starting and ending points of the route, as well as turns, and there is also the coordinate of the car. Due to the error, the vehicle coordinate may not be on the route line, but slightly to the side. How can I determine the nearest point on the route, which corresponds to the coordinate of the car, so that I can "pull" it to the route?
I store all data in postgresql, and the service is written in nodejs. Maybe there are specialized libraries that can be used for this task?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2020-12-24
@evgajukov

Postgis also has ClosedPoint. In general, this technique is called map matchingso as not to reinvent your wheel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question