haubourg / EasyCustomLabeling

plugin QGIS d'étiquetage manuel simplifié
9 stars 3 forks source link

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

Open GlaDal opened 7 years ago

GlaDal commented 7 years ago

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 commented 7 years ago

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" notifications@github.com 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:/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

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

haubourg commented 7 years ago

Hi @GlaDal , any new on that issue?

GlaDal commented 7 years ago

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

Bye