I'm very new to using GIS platforms.

I've sourced some spatial data for a archaeological project from the 'Portable Antiquities Scheme' website. There was a KML file available to download.

I'm not really familiar with KML file formats at all. From my understanding they don't import easily into QGIS (which is the GIS platform I'm using for my project), so you have to open them in Google Earth Pro and then save as a shapefile which you can then import into QGIS?

I've encountered a problem though in that I can't bring the KML file into Google Earth. I get a error a message which states:

... Junk after document element.

From a general google search I understand there might be something wrong with the formatting of the KML file possibly?

  • 2
    QGIS can read .kml files natively, so try skipping google earth. If neither qgis or google earth can read it, it is likely a corrupt .kml file coming from the archaeological project website.
    – jamierob
    Feb 14, 2019 at 21:52
  • 1
    Definitely sounds like the KML file is corrupt, it's the native file format for Google Earth so if GE can't open it..
    – Dan C
    Feb 14, 2019 at 22:02
  • 1
    Contact the 'Portable Antiquities Scheme' directly, and tell them the kml file on their website is corrupted. Request a functional copy of the data.
    – csk
    Feb 14, 2019 at 22:42
  • 2
    As others have said, if Google Earth can't open it, then the KML file is likely corrupted. If you can provide a link to the file, I'm happy to take a closer look. Also, not sure where you heard about converting KML to SHP in Google Earth, but that's not quite correct. Google Earth can convert SHP to KML, but not the other way around. QGIS can convert both directions... though note that its ability to open KML files is more limited than Earth, since KML files can contain mixed data types (point/line/polygon/groundoverlay/etc.), and QGIS can only handle one data type at a time. Feb 15, 2019 at 0:34
  • You can open a kml file in a text editor, such as Notepad++. Try opening it and seeing what the text looks like. If you're lucky, the corruption is just that someone typed in some extra lines that you can delete. Or you may be able to extract some correct features even if others are unsaveable. Have a look at this example KML on Wikipedia for comparison: en.wikipedia.org/wiki/Keyhole_Markup_Language#Structure
    – csk
    Feb 15, 2019 at 20:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.