1

I have a csv file with lat/long, site name, and a temperature field (I have this for something like 105 sites, but am just trying to get one site to work for now). Each row has a different date/time.

I am trying to get time manager to animate them in order with color or size changes based on mean temperature.

I get this error after I add the layer to time manager and hit ok (works fine if I don't have graduated symbols).

2017-03-27T10:26:42 0   Layer extents(datetime.datetime(2013, 6, 10, 0, 0), datetime.datetime(2016, 11, 3, 0, 0))
2017-03-27T10:26:42 0   Trying to create time interpolated layer with interpolation mode: Linear interpolation (point geometries only)
2017-03-27T10:26:42 2   An error occured while trying to add layer test to TimeManager. Cause: 'Traceback:Traceback (most recent call last):\n  File "C:/Users/justin/.qgis2/python/plugins\\timemanager\\timevectorinterpolatedlayer.py", line 53, in __init__\n    qgs.setLayerColor(self.memLayer, qgs.getLayerColor(self.layer))\n  File "C:/Users/justin/.qgis2/python/plugins\\timemanager\\qgis_utils.py", line 116, in getLayerColor\n    symbol = renderer.symbol()\nAttributeError: \'QgsGraduatedSymbolRendererV2\' object has no attribute \'symbol\'\n'Traceback (most recent call last):
          File "C:/Users/justin/.qgis2/python/plugins\timemanager\timemanagercontrol.py", line 635, in createTimeLayerFromRow
            self.iface)
          File "C:/Users/justin/.qgis2/python/plugins\timemanager\timevectorinterpolatedlayer.py", line 76, in __init__
            raise InvalidTimeLayerError("Traceback:" + traceback.format_exc(e))
        InvalidTimeLayerError: 'Traceback:Traceback (most recent call last):\n  File "C:/Users/justin/.qgis2/python/plugins\\timemanager\\timevectorinterpolatedlayer.py", line 53, in __init__\n    qgs.setLayerColor(self.memLayer, qgs.getLayerColor(self.layer))\n  File "C:/Users/justin/.qgis2/python/plugins\\timemanager\\qgis_utils.py", line 116, in getLayerColor\n    symbol = renderer.symbol()\nAttributeError: \'QgsGraduatedSymbolRendererV2\' object has no attribute \'symbol\'\n'

2017-03-27T10:26:49 0   Cleaning up interpolated layer test

My version: QGIS version 2.18.0 Time Manager version 2.3.2

  • Updating to QGIS 2.18.4 does not change the outcome. – Justin Rowell Mar 28 '17 at 22:41
1

qgis_util.py module in Time Manager plugin folder has getRenderer() method that returns layer renderer object.

def getRenderer(layer):
    if hasattr(layer, "rendererV2"):
        return layer.rendererV2() # for QGIS 2
    else:
        return layer.renderer()   # for QGIS 3

Renderer object can be an instance of any renderer class shown in this graph

getLayerColor, getLayerSize, setLayerColor and setLayerSize methods in the module use renderer.symbol() of layer renderer. But symbol() is just defined for QgsSingleSymbolRendererV2 class. So if you use different style aside 'Single Symbol', you most likely get an error.

The same is true for QGIS 3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.