getKMLcoordinates          package:maptools          R Documentation

_G_e_t _a _l_i_s_t _o_f _c_o_o_r_d_i_n_a_t_e_s _o_u_t _o_f _a _K_M_L _f_i_l_e

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

     This function parses a KML file to get the content of
     '<coordinates>' tags and returns a list of matrices representing
     the longitude-latitute or if 'ignoreAltitude' is 'FALSE' the
     longitude-latitute-altitude coordinates of a KML geometry.

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

     coords <- getKMLcoordinates(kmlfile, ignoreAltitude=FALSE)

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

 kmlfile: connection object or a character string of the KML file

ignoreAltitude: if set to 'TRUE' the altitude values of a KML points
          will be ignored

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

     'coords' is a list of matrices representing the longitude-latitute
     or if 'ignoreAltitude' is 'FALSE' the longitude-latitute-altitude
     coordinates

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

     Hans-J. Bibiko

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

     'kmlPolygon', 'kmlLine'

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

     data(wrld_simpl)
     ## creates a KML file containing the polygons of South Africa (plus hole)
     sw <- slot(wrld_simpl[wrld_simpl$NAME=="South Africa",], "polygons")[[1]]
     tf <- tempfile()
     kmlPolygon(sw, kmlfile=tf, name="South Africa", col="#df0000aa", lwd=5, 
         border=4, kmlname="R Test", 
         kmldescription="This is <b>only</b> a <a href='http://www.r-project.org'>R</a> test.")
     zz <- getKMLcoordinates(tf, ignoreAltitude=TRUE)
     str(zz)

