luka1199 / geo-heatmap

:world_map: Generate an interactive geo heatmap from your Google location data
MIT License
2.05k stars 226 forks source link

Error: list indexes must be integers or slides, not strings #24

Closed matthijsmelissen closed 4 years ago

matthijsmelissen commented 4 years ago

I get the following error message when running this script:

|##############################################################################################################################|100% ETA:  00:00:00
Traceback (most recent call last):
  File "geo_heatmap.py", line 222, in <module>
    generator.run(data_file, output_file, date_range)
  File "geo_heatmap.py", line 177, in run
    self.loadKMLData(data_file, date_range)
  File "geo_heatmap.py", line 93, in loadKMLData
    if self.timestampInRange(loc['timestampMs'], date_range):
TypeError: list indices must be integers or slices, not str

Input KML file:

<kml xmlns='http://www.opengis.net/kml/2.2' xmlns:gx='http://www.google.com/kml/ext/2.2'>
 <Document>
  <Placemark>
   <open>1</open>
   <gx:Track>
    <altitudeMode>clampToGround</altitudeMode>
    <when>2013-12-22T11:38:47Z</when>
    <gx:coord>-1.1 52.1 0</gx:coord>
   </gx:Track>
  </Placemark>
 </Document>
</kml>

Any idea what might cause this?

luka1199 commented 4 years ago

Can you run git pull in the folder? Or just redownload the project. This got fixed after you downloaded it

matthijsmelissen commented 4 years ago

This fixes it, thanks! Nice tool!