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

NameError: name 'tr' is not defined #14

Closed
dm-korottsev opened this issue Sep 5, 2019 · 5 comments
Closed

NameError: name 'tr' is not defined #14

dm-korottsev opened this issue Sep 5, 2019 · 5 comments

Comments

@dm-korottsev
Copy link

NameError: name 'tr' is not defined
Traceback (most recent call last):
File "C:/Users/d.korottsev/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\realcentroid\realcentroid.py", line 231, in run
self.generate()
File "C:/Users/d.korottsev/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\realcentroid\realcentroid.py", line 210, in generate
tr("Invalid or empty geometries found, see log messages"))
NameError: name 'tr' is not defined

Версия Python: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)]
Версия: 3.4.11-Madeira Madeira, 9a8a6d4687

@zsiki
Copy link
Owner

zsiki commented Sep 8, 2019

You probably have invalid or empty geometry in your input data. I fixed the Python error, but it will not fix the invalid geometry and realcentroid will stop.
The corrected code is available now on GitHub. Please download it from GitHub and report if the Python error disappeared. You should get a message " Invalid or empty geometries found, see log messages". If it's OK I will update it on the plugins.qgis.org.
Thanks reporting this issue.

@pathmapper
Copy link

@zsiki got the same error using the plugin from plugins.qgis.org and fixing the invalid geometries solved it in my case.

Happy to test your corrected code regarding the warning message from GitHub, but would need some guidance how to build/install the plugin from this repo. Running make results in an error (nothing to do for 'default').

@zsiki
Copy link
Owner

zsiki commented Sep 25, 2019 via email

@pathmapper
Copy link

@zsiki thanks, works great.

Now there is an alert (screenshot below) and the centroids are generated for all valid polygons.

realcentroid

@zsiki
Copy link
Owner

zsiki commented Sep 25, 2019

Great I'll prepare a new version and upload to the official QGIS plugin repository.
Thanks for your help!

@zsiki zsiki closed this as completed Sep 25, 2019
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

3 participants