Skip to main content
4 of 4
edited tags; edited title
underdark
  • 84.5k
  • 22
  • 233
  • 415

Converting KML with multiple layers to Shapefiles?

I have a KML-file (available here). It has several polygon paths for Alos/Palsar images.

I am in need to convert all these files from KML to shapefile, saving the layers using the layer "ID".

I am trying to use the piece of code bellow (PyQGIS), but I do not know how to unzip this KML and save the shapefiles using the layer "ID" information

vlayer = QgsVectorLayer("D:/KML-Images/A_Cycle06.kml", "line", "ogr")

writer = QgsVectorFileWriter.writeAsVectorFormat(vlayer, "D:/KML-Images/<layer ID>.shp", "utf-8", None, "ESRI Shapefile")