I am saving coordinate points sent from mobile device to redis database through geo redis npm package, But their is no function to get path location in which it was saved as I need them to get total distance traveled by user.Also i want to move all the points in MySql database.
I am able to get all the points saved with geo set with the help of command
```127.0.0.1:6379> ZRANGE rideLocations:345 0 -1```
but all values I found are are encoded in geo format like this
```
1) "1"
2) "3484047800163752"
3) "10"
4) "3484047800163752"
5) "2"
6) "3484047800163752"
7) "3"
8) "3484047800163752"
9) "4"
10) "3484047800163752"
11) "5"
12) "3484047800163752"
13) "6"
14) "3484047800163752"
15) "7"
16) "3484047800163752"
17) "8"
18) "3484047800163752"
19) "9"
20) "3484047800163752"
```
How can i get them in their real format{ lat: 23.234, lng: 45.5435 } or how can i convert them in their real format.
Or I any suggestion if I am storing in wrong type? How can I convert them before save into MySql. any command in nodejs.
To retrieve all the coordinates just search the entire planet, i.e.:
redis> GEORADIUS rideLocations:345 0 0 22000 km WITHCOORD
Note, however, that your description of the problem does not include ordering of the locations, which makes calculating a path impossible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With