Comments (4)
Oh yeah, you are indeed right there. Seems like a pretty mission-critical bug I've buried in there ...
from geodist.
It has been causing me a headache all afternoon.
from geodist.
Even more interesting:
dist3 <- geodist::geodist(mat)
dist3 <- dist3 [which (row (dist3) == (col (dist3) + 1))] # off-diagonal
identical (dist3, dist1) # FALSE
identical (dist3, dist2) # TRUE
it's actually a bug in the sequential method!
from geodist.
library(geodist)
mat <- matrix(c(-0.193011, 52.15549,
-0.197722, 52.15395,
-0.199949, 52.15527,
-0.199533, 52.15762,
-0.193205, 52.15757,
-0.174015, 52.17529),
ncol = 2, byrow = TRUE)
colnames(mat) <- c("lon","lat")
from <- mat[1:5,]
to <- mat[2:6,]
measures <- c ("haversine", "vincenty", "cheap", "geodesic")
res <- sapply (measures, function (m) {
dist1 <- geodist::geodist(mat, sequential = TRUE, measure = m)
dist2 <- geodist::geodist(from, to, paired = TRUE, measure = m)
dist3 <- geodist::geodist(mat, measure = m)
dist3 <- dist3 [which (row (dist3) == (col (dist3) + 1))] # off-diagonal
c (identical(dist1, dist2), identical(dist1, dist3), identical(dist2, dist3))
})
rownames (res) <- c ("seq-paired", "seq-default", "paired-default")
knitr::kable (res)
haversine | vincenty | cheap | geodesic | |
---|---|---|---|---|
seq-paired | TRUE | TRUE | FALSE | TRUE |
seq-default | TRUE | TRUE | FALSE | TRUE |
paired-default | TRUE | TRUE | TRUE | TRUE |
Created on 2019-04-11 by the reprex package (v0.2.1)
It's just a bug with sequential calculation using cheap distances ... now to find what must be an easy fix ...
from geodist.
Related Issues (20)
- Min/Max Feature HOT 6
- Test georange sequential
- DOC: "geodesic" is listed as "geodetic" in places HOT 1
- deploy pkgdown from travis
- Speed up R API by allowing direct submission of numeric vector objects HOT 13
- geodist gives different results for single row matrix with cheap ruler HOT 3
- Register C Callable HOT 5
- Thanks HOT 3
- Issue warning when cheapdist becomes inaccurate
- Update CRAN version with geodist_paired_vec HOT 6
- mention metres units in doc pages HOT 1
- meters instead of metres HOT 2
- Cheap is being expensive HOT 2
- geodist_max/min functions HOT 3
- error processing tibbles
- Updated version of package fails when y coordinate is called ymax HOT 4
- Request option not to warn when using cheap (or even test distances) HOT 2
- pkgcheck results - main HOT 9
- Fix package man entry
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geodist.