Learn R Programming

dodgr (version 0.4.3)

dodgr_streetnet_geodesic: Force weight_streetnet to use geodesic distances.

Description

Distances by default are Mapbox "cheap" distances if maximal network distances are < 100km, otherwise Haversine distances. Calling this function forces all calls to weight_streetnet from that point on to use geodesic distances. These are more computationally expensive to calculate, and weighting networks will likely take more time.

Usage

dodgr_streetnet_geodesic(unset = FALSE)

Value

Nothing; the function is called for its side-effect only of setting distance calculations to geodesic.

Arguments

unset

Calling this function with unset = TRUE reverts distance calculations to those described above, rather than geodesic.

See Also

Other extraction: dodgr_streetnet(), dodgr_streetnet_sc(), weight_railway(), weight_streetnet()

Examples

Run this code
net0 <- weight_streetnet (hampi) # Default "cheap" method
dodgr_streetnet_geodesic ()
net1 <- weight_streetnet (hampi)
cor (net0$d, net1$d) # Strongly correlated, but not perfect
max (abs (net0$d - net1$d)) # in metres

Run the code above in your browser using DataLab