symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Tom Chadwin
QGIS 2.18, qgis2web leafletRefactor branch  (https://github.com/tomchadwin/qgis2web/tree/leafletRefactor).

- open a point layer
- change marker type to SVG
- start qgis2web
- OpenLayers 3 preview works
- click Leaflet in plugin dialog
- RTTI error

The error is triggered by:

 sl = symbol.symbolLayer(0)
(https://github.com/tomchadwin/qgis2web/blob/leafletRefactor/leafletStyleScripts.py#L67)

However, these lines in the OpenLayers 3 export code does not trigger the RTTI error:

for i in xrange(symbol.symbolLayerCount()):
    sl = symbol.symbolLayer(i)
(https://github.com/tomchadwin/qgis2web/blob/leafletRefactor/olwriter.py#L851)

I just don't understand how the same method - symbol.symbolLayer(n) - can trigger the error in one place but not in the other (with everything identical in QGIS).

Matthias has removed the problem by removing the dependence of the SIP symbol bindings on RTTI (https://github.com/qgis/QGIS/commit/c3852c0). However, I still wonder if I can work around the issue, given that the OpenLayers call to symbol.symbolLayer(n) doesn't trigger the error.

If I can work around it, I could maintain qgis2web compatibility back to 2.8 as I currently do. Otherwise, I'll have to switch to 2.18, and I don't like not supporting LTR (or I'll have to ask for c3852c0 to be backported to 2.14).

Does anyone have any ideas?

Thanks

Tom
Reply | Threaded
Open this post in threaded view
|

Re: symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Matthias Kuhn 🌍
Hi Tom,

If we are lucky, 2.14 users also no longer suffer from this issue as of
the next nighly build [1]

Bests
Matthias

[1]
https://github.com/qgis/QGIS/commit/176987ea0d352ae1b1d2a7bdc0daab176a24c69c

On 11/21/2016 12:03 PM, Tom Chadwin wrote:

> QGIS 2.18, qgis2web leafletRefactor branch
> (https://github.com/tomchadwin/qgis2web/tree/leafletRefactor).
>
> - open a point layer
> - change marker type to SVG
> - start qgis2web
> - OpenLayers 3 preview works
> - click Leaflet in plugin dialog
> - RTTI error
>
> The error is triggered by:
>
>  sl = symbol.symbolLayer(0)
> (https://github.com/tomchadwin/qgis2web/blob/leafletRefactor/leafletStyleScripts.py#L67)
>
> However, these lines in the OpenLayers 3 export code does not trigger the
> RTTI error:
>
> for i in xrange(symbol.symbolLayerCount()):
>     sl = symbol.symbolLayer(i)
> (https://github.com/tomchadwin/qgis2web/blob/leafletRefactor/olwriter.py#L851)
>
> I just don't understand how the same method - symbol.symbolLayer(n) - can
> trigger the error in one place but not in the other (with everything
> identical in QGIS).
>
> Matthias has removed the problem by removing the dependence of the SIP
> symbol bindings on RTTI (https://github.com/qgis/QGIS/commit/c3852c0).
> However, I still wonder if I can work around the issue, given that the
> OpenLayers call to symbol.symbolLayer(n) doesn't trigger the error.
>
> If I can work around it, I could maintain qgis2web compatibility back to 2.8
> as I currently do. Otherwise, I'll have to switch to 2.18, and I don't like
> not supporting LTR (or I'll have to ask for c3852c0 to be backported to
> 2.14).
>
> Does anyone have any ideas?
>
> Thanks
>
> Tom
>
>
>
> -----
> Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/symbol-symbolLayer-n-triggers-RTTI-error-in-one-place-but-doesn-t-in-another-tp5296740.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
_______________________________________________
Qgis-developer mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Tom Chadwin
Many thanks. I'd still like to know why the method consistently fails in one instance, and always works in the other, though.

What's the timescale for 2.14.9?

Thanks again

Tom
Reply | Threaded
Open this post in threaded view
|

Re: symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Matthias Kuhn 🌍
On 11/21/2016 12:37 PM, Tom Chadwin wrote:
> Many thanks. I'd still like to know why the method consistently fails in one
> instance, and always works in the other, though.

Me too...
Random suspicions: different imports, different origin of the symbol
objects, different symbols in use...

>
> What's the timescale for 2.14.9?

Looks like this Friday is release day:

https://www.qgis.org/en/site/getinvolved/development/roadmap.html#release-schedule

-- Matthias

>
> Thanks again
>
> Tom
>
>
>
> -----
> Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/symbol-symbolLayer-n-triggers-RTTI-error-in-one-place-but-doesn-t-in-another-tp5296740p5296743.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
_______________________________________________
Qgis-developer mailing list
[hidden email]
List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Tom Chadwin
> different imports

Could be. I'll try to check.

> different origin of the symbol
objects

Data in QGIS exactly the same, so I don't think so.

> different symbols in use...

Definitely not, for the same reason.
Reply | Threaded
Open this post in threaded view
|

Re: symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Tom Chadwin
Assuming only QGIS imports are relevant, the working code imports iface, while the non-working doesn't. However, importing it doesn't stop the error.
Reply | Threaded
Open this post in threaded view
|

Re: symbol.symbolLayer(n) triggers RTTI error in one place, but doesn't in another

Tom Chadwin
I'm afraid the Windows LTR nightly, with that commit, minidumps on that line now. Removing the line stops the dump.

However, I've delved into this a lot further this morning, and I think it's a mistake I made some months ago. The dump no longer happens if I startRender() before it and stopRender() after it.

I'm still not getting the results I expect (symbolLayer(0) returns None instead of QgsSvgMarkerSymbolLayerV2), but at least it's a different problem for me to work on.

Apologies if this is the problem, and I've wasted your time, and as always, thanks

Tom