Bulk lat long distance calcuations with Cheap-Ruler
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

I need a small application coded over at https://replit.com/ that will use this lib called Cheap-Ruler to calculate a bunch of geo distances from a csv file. I have the csv file located here, https://docs.google.com/spreadsheets/d/1k-WkJaSXZuRrvsdzYPBkC8fngBNU8CH_3d7RpjJakW4/edit?usp=sharing you can save it out as csv to put in your repl locally in the app (it doesnt need to download it) and then it will run against each line to quickly figure out the distance of each and the amount of time that calculation took (can be in ns or ms) it should output a new txt or csv file in the repl when its done. here is a link to the rules code to use for this https://github.com/mapbox/cheap-ruler

awarded to b44ken-

Crowdsource coding tasks.

1 Solution

Winning solution

how's this? replit.com/@Bak0n/distance

should console log a valid csv, i.e. node index.js > distances.csv

hey this is great, 2 things i notice. if i clear distance.csv and run it , it does not populate again with new values? or if i just delete the file a new one is not made. next i notice it doesnt seem to put a time in the row. all of them are marked as 0. thanks!
Qdev 5 months ago
it seems to repopulate for me. maybe try forking or running locally? as for the times: the script finishes in about 4.9 seconds, so the average per row is about 0.114ms. JS Date just rounds this down to zero.
b44ken- 5 months ago
I need non zero times for benchmarking purposes. We are running scenarios to see how much distance plays a part of total calculation time. Do you have any ideas for how to print the actual high precision time?
Qdev 5 months ago
Maybe something like this helps? https://github.com/googleapis/nodejs-precise-date
Qdev 5 months ago
i updated the repl to use nanoseconds with process.hrtime.bigint()
b44ken- 5 months ago