As the title states when I import a KML file into R the Description column is blank despite the data being visible when the same file is viewed in QGIS. The KML file was a KMZ file from the Avenza app. I changed the ending from file.kmz to file.zip and then uncompressed the file. (Since the same file appears correctly in QGIS this doesn't seem to be the problem but I thought I would include it for just in case)

I then imported the resulting KML file using:

kml.data <- readOGR(C:/file.kml, layer = ogrListLayers(C:/file.kml))

It appears that issue is happening in this line of code because the 'Name' column is imported correctly, the 'Description' column is empty, although no error or warning message occurs.

What is the problem and how do I solve it?

EDIT: Here is a test KML file that is exhibiting the same behavior: Test file

EDIT 2: One additional thing that I have noticed is that the column is not showing NAs despite all cells being blank. The column class is factor with its one level: "".

  • 1
    Could you upload an example file? Have you tried SF? – Sergio Jan 9 at 3:09
  • I could (I think) load a file but my thought was that it is something not specific to the file itself but to the loading of any KML file in R using the method above. What is SF? – ia200 Jan 9 at 17:10
  • I created a test file and added a link to the original post. – ia200 Jan 9 at 17:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.