M
M
Maxim Grechushnikov2015-10-14 01:12:16
PHP
Maxim Grechushnikov, 2015-10-14 01:12:16

How to calculate the nearest distance to the subway?

There are two tasks. Companies are placed on the map and you need to make blocks:
1. 5 closest companies with the output of how much distance they are from the current one
2. display the nearest metro to the company
at the entrance there is an address and lat, lon. Is it possible to somehow calculate everything with mysql? Maybe it's somehow mathematically (geometry after all) is considered?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Moskus, 2015-10-14
@maxyc_webber

It's possible, like this:
gis.stackexchange.com/questions/31628/find-points-...
If you had a base that fully supports geospatial functions (that is, it can project geographic coordinates into flat rectangular ones, for example) it would be easier.

A
Artem Spiridonov, 2015-10-14
@customtema

If there are coordinates of the current point and the nearest metro station, then the direct path can be found using school geometry methods. If you need a path through the streets - through the maps API.

S
shagguboy, 2015-10-14
@shagguboy

https://dev.mysql.com/doc/refman/5.6/en/spatial-ex...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question