springmeyer / arc.js

great circle routes in javascript
http://springmeyer.github.io/arc.js/
BSD 2-Clause "Simplified" License
369 stars 70 forks source link

Support for Decimal Precision #51

Closed KD33 closed 1 month ago

KD33 commented 1 year ago

Is it possible to provide decimal precision as an option to generator.Arc? I'm working on optimizing a workflow that requires drawing a lot of lines. One of the optimizations I am making is to limit the precision of coordinate values (suggested by MapBox under the section Cleaning up your data https://docs.mapbox.com/help/troubleshooting/working-with-large-geojson-data/).

Trimming the precision at the same time that the coordinates are generated would save me the trouble of having to iterate through the coordinates after

Thanks

jgravois commented 1 year ago

given that this isn't remotely professional grade surveying, my gut reaction is that the library would be best off rounding to 6 decimal places internally and calling it a day. happy to discuss alternatives if anyone has concerns though.

KD33 commented 1 year ago

That works. Thanks

jgravois commented 1 year ago

a PR for this would be welcome. i don't plan on tackling it myself.

KD33 commented 1 year ago

a PR for this would be welcome. i don't plan on tackling it myself.

Sure. See PR 52

jgravois commented 1 month ago

closed by #53 (better late than never)