Two steps: (1) enable KML drivers for fiona:
fiona.drvsupport.supported_drivers['kml'] = 'rw' # enable KML support
fiona.drvsupport.supported_drivers['KML'] = 'rw'
(2) Unzip the KMZ file to find the embedded KML file (my example assumes this to be called doc.kml but that may not always be the case) from zipfile import ZipFile
kmz = ZipFile(kmlFilename, 'r')
kmz.extract('doc.kml', tempDir)
Now you should be able to open the kml file with fiona, or geopandas etc
import geopandas as gpd
gdf = gpd.read_file(os.path.join(tempDir,'doc.kml'))
Two steps: (1) enable KML drivers for fiona: fiona.drvsupport.supported_drivers['kml'] = 'rw' # enable KML support fiona.drvsupport.supported_drivers['KML'] = 'rw'
(2) Unzip the KMZ file to find the embedded KML file (my example assumes this to be called doc.kml but that may not always be the case) from zipfile import ZipFile kmz = ZipFile(kmlFilename, 'r') kmz.extract('doc.kml', tempDir)
Now you should be able to open the kml file with fiona, or geopandas etc import geopandas as gpd gdf = gpd.read_file(os.path.join(tempDir,'doc.kml'))