Decompressing multiple KMZs errors

66
0
02-25-2019 09:19 AM
RobertHarvey
New Contributor

I need to able to read multiple KMZs to read each doc.kml for ExtendedData/Data to populate the KMLToLayer Feature class's Attribute Table. I have wired up a 'File' control in my ArcToolbox and have it configured for multiple input. When I make the call zipfile.ZipFile(kmzFile, 'r') below:

kmzInput = arcpy.GetParameterAsText(0)

kmzFiles = kmzInput.split(';')

for kmzFile in kmzFiles:      <-----kmzFile is of type 'str'

   tempOut=tempfile.mkdtemp()

   zf=zipfile.ZipFile(kmzFile, 'r')  <------ crashes here

                              

I get the an error:

         self.fp = io.open(file, filemode)

      OSError: [ Errno 22] Invalid argument: " 'C:\\work\\ArcpyTestData\foo.kmz' "

Note, the path to the KMZ DOES EXIST. I am running ArcPro 2.0.1. Any help is much appreciated

Thanks

V/R

0 Kudos
0 Replies