spDistsN1                 package:sp                 R Documentation

_E_u_c_l_i_d_e_a_n _o_r _G_r_e_a_t _C_i_r_c_l_e _d_i_s_t_a_n_c_e _b_e_t_w_e_e_n _p_o_i_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     The function returns a vector of distances between a matrix of 2D
     points and a single 2D point, using Euclidean or Great Circle
     distance (WGS84 ellipsoid) methods.

_U_s_a_g_e:

     spDistsN1(pts, pt, longlat = FALSE)

_A_r_g_u_m_e_n_t_s:

     pts: A matrix of 2D points

      pt: A single 2D point

 longlat: if FALSE, Euclidean distance, if TRUE Great Circle distance

_V_a_l_u_e:

     A numeric vector of distances in the metric of the points if
     longlat=FALSE, or in kilometers if longlat=TRUE

_N_o_t_e:

     The function can also be used to find a local kilometer equivalent
     to a plot scaled in decimal degrees in order to draw a scale bar.

_A_u_t_h_o_r(_s):

     Roger Bivand

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://home.att.net/~srschmitt/script_greatcircle.html>

_S_e_e _A_l_s_o:

     'is.projected'

_E_x_a_m_p_l_e_s:

     ll <- matrix(c(5, 6, 60, 60), ncol=2)
     km <- spDistsN1(ll, ll[1,], longlat=TRUE)
     zapsmall(km)
     utm32 <- matrix(c(276.9799, 332.7052, 6658.1572, 6655.2055), ncol=2)
     spDistsN1(utm32, utm32[1,])
     dg <- spDistsN1(ll, ll[1,])
     dg
     dg[2]/km[2]

