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

[Qgis 2.16]'NoneType' object has no attribute 'centroid' #17

Open
GlaDal opened this issue Oct 8, 2016 · 3 comments
Open

[Qgis 2.16]'NoneType' object has no attribute 'centroid' #17

GlaDal opened this issue Oct 8, 2016 · 3 comments

Comments

@GlaDal
Copy link

GlaDal commented Oct 8, 2016

Dear Mr Haubourg,

After having using your plugin during a stage several problems appear. First at all, the easiest to explain for me is this one. When I want to use the plugin (on the same data of 15 others persons, only one person had this message) Qgis returns this message :

Une erreur est survenue lors de l'éxécution du code Python:

AttributeError: 'NoneType' object has no attribute 'centroid'

Traceback (most recent call last):
File "C:/Users/formation14/.qgis2/python/plugins\EasyCustomLabeling\EasyCustomLabeling.py", line 506, in runLabel
WKTLine = 'LINESTRING('+ str(geom.centroid().asPoint().x() +0.0001) +' '+ str(geom.centroid().asPoint().y() +0.0001 ) + ' , '+ str(geom.centroid().asPoint().x())+ ' ' +str(geom.centroid().asPoint().y())+ ')'
AttributeError: 'NoneType' object has no attribute 'centroid'

Version de Python : 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]
Version de QGIS : 2.16.3 Nødebo, 7d00cae

Chemin Python :

C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins\processing
C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python
C:/Users/formation14/.qgis2/python
C:/Users/formation14/.qgis2/python/plugins
C:/PROGRA~1/QGIS2~1.16/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg
C:\PROGRA~1\QGIS2~1.16\bin\python27.zip
C:\PROGRA~1\QGIS2~1.16\apps\Python27\DLLs
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\plat-win
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\lib-tk
C:\PROGRA~1\QGIS2~1.16\bin
C:\PROGRA~1\QGIS2~1.16\apps\Python27
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\PIL
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\win32
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA~1\QGIS2~1.16\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/formation14/.qgis2//python
C:\Users\formation14\.qgis2\python\plugins\mmqgis/forms
C:/STAGIAIRES_v5/Dossier_Operation

Thanks for all

@haubourg
Copy link
Owner

haubourg commented Oct 8, 2016

Hi same here can you share the data set? I suspect invalid geometries here.
Merci
Régis

Le 8 oct. 2016 2:30 PM, "GlaDal" [email protected] a écrit :

Dear Mr Haubourg,

After having using your plugin during a stage several problems appear.
First at all, the easiest to explain for me is this one. When I want to use
the plugin (on the same data of 15 others persons, only one person had this
message) Qgis returns this message :

Une erreur est survenue lors de l'éxécution du code Python:

AttributeError: 'NoneType' object has no attribute 'centroid'

Traceback (most recent call last):
File "C:/Users/formation14/.qgis2/python/plugins\EasyCustomLabeling\EasyCustomLabeling.py",
line 506, in runLabel
WKTLine = 'LINESTRING('+ str(geom.centroid().asPoint().x() +0.0001) +' '+
str(geom.centroid().asPoint().y() +0.0001 ) + ' , '+
str(geom.centroid().asPoint().x())+ ' ' +str(geom.centroid().asPoint().y())+
')'
AttributeError: 'NoneType' object has no attribute 'centroid'

Version de Python : 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64
bit (AMD64)]
Version de QGIS : 2.16.3 Nødebo, 7d00cae

Chemin Python :

C:/PROGRA1/QGIS21.16/apps/qgis/./python/plugins\processing
C:/PROGRA1/QGIS21.16/apps/qgis/./python
C:/Users/formation14/.qgis2/python
C:/Users/formation14/.qgis2/python/plugins
C:/PROGRA1/QGIS21.16/apps/qgis/./python/plugins
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\matplotlib-1.3.1-py2.7-win-amd64.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\nose-1.3.3-py2.7.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\tornado-4.0.1-py2.7-win-amd64.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\backports.ssl_match_hostname-3.4.0.2-py2.7.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\certifi-14.05.14-py2.7.egg
C:\PROGRA1\QGIS21.16\bin\python27.zip
C:\PROGRA1\QGIS21.16\apps\Python27\DLLs
C:\PROGRA1\QGIS21.16\apps\Python27\lib
C:\PROGRA1\QGIS21.16\apps\Python27\lib\plat-win
C:\PROGRA1\QGIS21.16\apps\Python27\lib\lib-tk
C:\PROGRA1\QGIS21.16\bin
C:\PROGRA1\QGIS21.16\apps\Python27
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\PIL
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\jinja2-2.7.2-py2.7.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\markupsafe-0.23-py2.7-win-amd64.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\pytz-2012j-py2.7.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\win32
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\win32\lib
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\Pythonwin
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\wx-2.8-msw-unicode
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg
C:\PROGRA1\QGIS21.16\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg
C:/Users/formation14/.qgis2//python
C:\Users\formation14.qgis2\python\plugins\mmqgis/forms
C:/STAGIAIRES_v5/Dossier_Operation

Thanks for all


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#17, or mute the
thread
https://github.com/notifications/unsubscribe-auth/ABjencR7YQNxnzLh6IqT1NZjXyk6R7n-ks5qx4zVgaJpZM4KRtWo
.

@haubourg
Copy link
Owner

Hi @GlaDal , any new on that issue?

@GlaDal
Copy link
Author

GlaDal commented Jun 2, 2017

No sorry but I can ask to my colleague who give the last formation.

Bye

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

No branches or pull requests

2 participants