Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'QgsLinePatternFillSymbolLayer' object has no attribute 'borderColor' error exporting layer poly vector with linear pattern style #217

Open
marcobra opened this issue Mar 25, 2015 · 5 comments

Comments

@marcobra
Copy link

Here the qgis project to test this bug report: https://db.tt/4PVgTlwl
expand it into /tmp dir and try

Traceback (most recent call last):
File "/home/ubuntu/.qgis2/python/plugins/qgis2leaf/qgis2leafdialog.py", line 297, in export2leaf
qgis2leaf_exec(self.outFileName, self.basemapName, self.basemapMeta, self.basemapAddress, self.width, self.height, self.extent, self.full_screen, self.layer_list, self.visible, self.opacity, self.encode2JSON,self.createcluster, self.webpage_name, self.webmap_head,self.webmap_subhead, self.legend,self.locate,self.address, self.precision, self.labels, self.labelshover, self.matchCRS, self.selected)
File "/home/ubuntu/.qgis2/python/plugins/qgis2leaf/qgis2leaf_exec.py", line 273, in qgis2leaf_exec
borderColor_str = str(i.rendererV2().symbol().symbolLayer(0).borderColor().name())
AttributeError: 'QgsLinePatternFillSymbolLayer' object has no attribute 'borderColor'

Versione Python:
2.7.6 (default, Mar 22 2014, 23:03:41)
[GCC 4.8.2]

Versione di QGIS:
2.8.1-Wien Wien, exported

@tomchadwin
Copy link
Contributor

Can you try changing from a pattern fill to a plain fill, and see if the error goes away?

@marcobra
Copy link
Author

Yes, i know, without linear pattern fill i get no error...

@tomchadwin
Copy link
Contributor

In the short term, I'm not sure we can do much better than to trap the error properly. I don't know if Leaflet supports a pattern fill. If it does, we will have to extract the pattern into a web-friendly image format (which tiles, obviously).

Any ideas on how to pursue this one are gratefully received.

@tomchadwin
Copy link
Contributor

If we trap the error, we can just substitute a plain fill.

@marcobra
Copy link
Author

Will be nice to manage this error in some way.
Catch the error, show to user a warning, "The pattern fill conversion isn't supported, so layer: NAME_OF_LAYER pattern will be converted to plain fill" and then convert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants