RdlP
RdlP

Reputation: 1396

Simulate geoNear or near from mongoDB in MySQL

In mongoDB there is a command called geoNear that return the distance to geospatial point store in DB. Also when I use find function in mongoDB I can use a near filter that return registers in DB that is in maxDistance range, for example:

db.collection.find( { localizacion:{ $near: { $geometry: { type: "Point", coordinates: [lng, lat]}}, $maxDistance: 1000}}).

That sentence return the registers in DB that are in 1000 meters from [lng, lat].

So, there is any similar in MySQL?

Thanks you.

Upvotes: 4

Views: 901

Answers (1)

Related Questions