[R-sig-Geo] reading KML files in R

Roger Bivand Roger.Bivand at nhh.no
Thu May 27 20:15:33 CEST 2010


On Thu, 27 May 2010, rick reeves wrote:

> I do note that the example I provided does not demonstrate how to READ a KML
> file into R. But, SOON, I plan to modify the example to demonstrate reading 
> of KMLs
> into some R-compatible format.

readOGR() does read KML files, but you do have to identify the correct 
layer name - see:

http://www.gdal.org/ogr/drv_kml.html

Roger

>
> RR
>
> On 5/27/2010 10:15 AM, Wade Wall wrote:
>> Hi all,
>> 
>> Does anyone have experience reading and writing KML files in R?  I
>> have seen several threads that seem to suggest that it is difficult if
>> not impossible, but it is convenient to use KML files when working
>> with Google Earth and inconvenient to read and write shapefiles and
>> then convert to KML using other software.
>> 
>> If anyone is able to read and write KML files, if they could provide a
>> description of how to do it, I am sure a lot of people would
>> appreciate it.  I have tried to do so under both Windows and Linux to
>> no avail.  The Windows approach looks more difficult, judging by the
>> readme file associated with rgdal.
>> 
>> Thanks,
>> 
>> Wade
>> 
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>> 
>
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no



More information about the R-sig-Geo mailing list