Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

which metrics? #1

Closed
mpadge opened this issue Jun 6, 2018 · 5 comments
Closed

which metrics? #1

mpadge opened this issue Jun 6, 2018 · 5 comments

Comments

@mpadge
Copy link
Member

mpadge commented Jun 6, 2018

here you go @mdsumner - this should be very quick to assemble. We can just start with vectorized C++ implementations of:

  1. Haversine
  2. Vincenty
  3. Mapbox cheap, as explained in this blog post.

This will all be able to be done quickly with only Rcpp dep, but we could even dump that and then be essentially dependency free?

@mpadge
Copy link
Member Author

mpadge commented Jun 6, 2018

And by the way: available::available("geodist") gives the all-clear

@mdsumner
Copy link
Member

mdsumner commented Jun 6, 2018

I'm happy with these and Rcpp, for now Rcpp is basically an assumed basic most of the time!

@mdsumner
Copy link
Member

mdsumner commented Jun 6, 2018

I'm inclined to default to metres as the basic assumed unit as it is with projections - do you feel strongly for km?

geosphere is metres but others km (or miles :)

x0 <- cbind(0, 0)
x1 <- cbind(0, 1)
## m  
geosphere::distGeo(x0, x1)
# [1] 110574.4

## km 
spDistsN1(x0, x1, longlat = T)
# [1] 110.5731

## km 
fields::rdist.earth(x0, x1, miles = FALSE)
# [1,] 111.3239

I think we (royal) tend to work in m/s as a default rather than km/h - is there a stronger established convention outside of R?

EDIT: it seems cheap ruler uses km default so maybe I need to suck it up

@mpadge
Copy link
Member Author

mpadge commented Jun 6, 2018

I'm easy on that, but one advantage of default km would be an ability to offer miles as well. That'd require another param, so we may as well just add units and enable ask options, right? I can't really see us facing much of a parameter overload issue

@mpadge
Copy link
Member Author

mpadge commented Jun 13, 2018

closing this now that the big three have been implemented, and opening a units issue to finish the job

@mpadge mpadge mentioned this issue Jun 13, 2018
Closed
@mpadge mpadge closed this as completed Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants