-
Notifications
You must be signed in to change notification settings - Fork 2
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
move to QGIS 3.0 with PyQt5 #6
base: master
Are you sure you want to change the base?
Conversation
Hi Adrien, AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures' I hope you can help. Fabian |
Hi Fabian,
You seem to use a raster layer, but you need to use vectorlayer, with at
least one polyline feature,
please make sure the active layer is your vectorlayer before to run the
plugin function "move parallel"
Best regards,
Adrien
Le mar. 5 nov. 2019 à 12:21, Eierbrot <[email protected]> a écrit :
… Hi Adrien,
thanks a lot for the great work! I adapted all your changes and can now
use the plugin in QIS 3.10. I do, however, get an error message when trying
to run the plugin and can't seem to find a way to solve the problem. You
must know, that I hardly have any coding experience at all.
Do you know what to do to resolve this problem? Here's the error message
that I receive when trying to run the plugin:
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
Traceback (most recent call last):
File "C:/Users/fabia/AppData/Roaming/QGIS/QGIS3\profiles\Fabian
Kratz/python/plugins\ParallelOffset\paralleloffset.py", line 132, in run
for feature in layer.selectedFeatures():
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
I hope you can help.
Thanks a lot in advance.
Fabian
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6?email_source=notifications&email_token=AAZTKCT4XVHZASDGNSUC5KDQSFJJZA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDCP45A#issuecomment-549781108>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZTKCRRW6QSFD2ARD7IAQDQSFJJZANCNFSM4E3G5GSQ>
.
|
Hi Adrien,
Thanks for the quick reply.
Well, it is a vector layer with polylines, that’s what really confused me. I thought about deleting the line of code that’s responsible for checking whether the layer is a vector layer or not, but I’m not sure whether this solves the problem. Also, I don’t know how to debug the plugin after changing it.
Mit freundlichen Grüßen
Fabian Kratz
Von: Adrien Gressin <[email protected]>
Gesendet: Dienstag, 5. November 2019 20:25
An: stevengardiner/ParallelOffset_plugin <[email protected]>
Cc: Fabian Kratz <[email protected]>; Comment <[email protected]>
Betreff: Re: [stevengardiner/ParallelOffset_plugin] move to QGIS 3.0 with PyQt5 (#6)
Hi Fabian,
You seem to use a raster layer, but you need to use vectorlayer, with at
least one polyline feature,
please make sure the active layer is your vectorlayer before to run the
plugin function "move parallel"
Best regards,
Adrien
Le mar. 5 nov. 2019 à 12:21, Eierbrot <[email protected]<mailto:[email protected]>> a écrit :
Hi Adrien,
thanks a lot for the great work! I adapted all your changes and can now
use the plugin in QIS 3.10. I do, however, get an error message when trying
to run the plugin and can't seem to find a way to solve the problem. You
must know, that I hardly have any coding experience at all.
Do you know what to do to resolve this problem? Here's the error message
that I receive when trying to run the plugin:
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
Traceback (most recent call last):
File "C:/Users/fabia/AppData/Roaming/QGIS/QGIS3\profiles\Fabian
Kratz/python/plugins\ParallelOffset\paralleloffset.py", line 132, in run
for feature in layer.selectedFeatures():
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
I hope you can help.
Thanks a lot in advance.
Fabian
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6?email_source=notifications&email_token=AAZTKCT4XVHZASDGNSUC5KDQSFJJZA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDCP45A#issuecomment-549781108>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZTKCRRW6QSFD2ARD7IAQDQSFJJZANCNFSM4E3G5GSQ>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6?email_source=notifications&email_token=ANV44DWUUALAUZ327HRO7LLQSHB7HA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDEAN6I#issuecomment-549979897>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANV44DW7QRZDDFP2WY6SXL3QSHB7HANCNFSM4E3G5GSQ>.
|
Hi Fabian
Could you send me your code and I’ll see if I can fix it. I’m still using QGIS 2 and haven’t migrated over to 3 yet but happy to take a look.
To debug the plugin code just delete the .pyc file and then the plugin will use the .py file
Regards
Steven Gardiner
[cid:[email protected]]
Steven Gardiner
Uwch-ddatblygwr rhaglenni
Senior Applications Developer
• 01792 636432
• [email protected]<mailto:[email protected]>
• [email protected]<mailto:[email protected]>
From: Eierbrot <[email protected]>
Sent: 06 November 2019 08:01
To: stevengardiner/ParallelOffset_plugin <[email protected]>
Cc: Subscribed <[email protected]>
Subject: Re: [stevengardiner/ParallelOffset_plugin] move to QGIS 3.0 with PyQt5 (#6)
Hi Adrien,
Thanks for the quick reply.
Well, it is a vector layer with polylines, that’s what really confused me. I thought about deleting the line of code that’s responsible for checking whether the layer is a vector layer or not, but I’m not sure whether this solves the problem. Also, I don’t know how to debug the plugin after changing it.
Mit freundlichen Grüßen
Fabian Kratz
[mam_logo]
Junkendiek 13
49479 Ibbenbüren
Tel +49 5451 9383730
Mobil +49 1512 0939821
[email protected]<mailto:[email protected]>
www.mam-bau.com<http://www.mam-bau.com/>
Geschäftsführer:
Musa Hyseni
Eingetragen beim Amtsgericht Steinfurt HRA 7010
Pers.-haft Ges. MAM-Verwaltungsgesellschaft mbH
Amtsgericht Steinfurt HRB 11201
Ust.-IdNr.: DE125501852
Von: Adrien Gressin <[email protected]>
Gesendet: Dienstag, 5. November 2019 20:25
An: stevengardiner/ParallelOffset_plugin <[email protected]>
Cc: Fabian Kratz <[email protected]>; Comment <[email protected]>
Betreff: Re: [stevengardiner/ParallelOffset_plugin] move to QGIS 3.0 with PyQt5 (#6)
Hi Fabian,
You seem to use a raster layer, but you need to use vectorlayer, with at
least one polyline feature,
please make sure the active layer is your vectorlayer before to run the
plugin function "move parallel"
Best regards,
Adrien
Le mar. 5 nov. 2019 à 12:21, Eierbrot <[email protected]<mailto:[email protected]>> a écrit :
Hi Adrien,
thanks a lot for the great work! I adapted all your changes and can now
use the plugin in QIS 3.10. I do, however, get an error message when trying
to run the plugin and can't seem to find a way to solve the problem. You
must know, that I hardly have any coding experience at all.
Do you know what to do to resolve this problem? Here's the error message
that I receive when trying to run the plugin:
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
Traceback (most recent call last):
File "C:/Users/fabia/AppData/Roaming/QGIS/QGIS3\profiles\Fabian
Kratz/python/plugins\ParallelOffset\paralleloffset.py", line 132, in run
for feature in layer.selectedFeatures():
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
I hope you can help.
Thanks a lot in advance.
Fabian
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6?email_source=notifications&email_token=AAZTKCT4XVHZASDGNSUC5KDQSFJJZA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDCP45A#issuecomment-549781108>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZTKCRRW6QSFD2ARD7IAQDQSFJJZANCNFSM4E3G5GSQ>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6?email_source=notifications&email_token=ANV44DWUUALAUZ327HRO7LLQSHB7HA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDEAN6I#issuecomment-549979897>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANV44DW7QRZDDFP2WY6SXL3QSHB7HANCNFSM4E3G5GSQ>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#6?email_source=notifications&email_token=AA2HXNA7DUXQON4VNE7QJGTQSJ2THA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDFUHDQ#issuecomment-550192014>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA2HXNGEEWKJOT4QRNL377DQSJ2THANCNFSM4E3G5GSQ>.
*****************************************************************
Mae'r e-bost hwn ac unrhyw ffeiliau a drosglwyddir gydag ef yn gyfrinachol ac at ddefnydd yr unigolyn neu'r corff y cyfeiriwyd hwy atynt yn unig. Os ydych wedi derbyn yr e-bost hwn drwy gamgymeriad, dylech hysbysu'r gweinyddydd yn y cyfeiriad canlynol: [email protected]
Bydd yr holl ohebiaeth a anfonir at y Cyngor neu ganddo yn destun cofnodi a/neu fonitro yn unol â’r ddeddfwriaeth berthnasol
Croesewir gohebiaeth yn y Gymraeg a byddwn yn ymdrin â gohebiaeth Gymraeg a Saesneg i’r un safonau ac amserlenni.
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the administrator on the following address: [email protected]
All communications sent to or from the Council may be subject to recording and/or monitoring in accordance with relevant legislation
We welcome correspondence in Welsh and will deal with Welsh and English correspondence to the same standards and timescales.
*******************************************************************
|
Hi Steven,
Thanks a lot for your offer to help and all the effort you put into this, it’s really appreciated!
I essentially used the code Adrien provided to migrate the plugin over to QGIS 3. All the changes mentioned here, I adapted to your original code, always keeping an eye out for correct indentation and everything:
61bab9c
I really hope you can help 😉
Mit freundlichen Grüßen
Fabian Kratz
Von: stevengardiner <[email protected]>
Gesendet: Mittwoch, 6. November 2019 10:38
An: stevengardiner/ParallelOffset_plugin <[email protected]>
Cc: Fabian Kratz <[email protected]>; Comment <[email protected]>
Betreff: Re: [stevengardiner/ParallelOffset_plugin] move to QGIS 3.0 with PyQt5 (#6)
Hi Fabian
Could you send me your code and I’ll see if I can fix it. I’m still using QGIS 2 and haven’t migrated over to 3 yet but happy to take a look.
To debug the plugin code just delete the .pyc file and then the plugin will use the .py file
Regards
Steven Gardiner
[cid:[email protected]]
Steven Gardiner
Uwch-ddatblygwr rhaglenni
Senior Applications Developer
• 01792 636432
• [email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>
• [email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>
From: Eierbrot <[email protected]<mailto:[email protected]>>
Sent: 06 November 2019 08:01
To: stevengardiner/ParallelOffset_plugin <[email protected]<mailto:[email protected]>>
Cc: Subscribed <[email protected]<mailto:[email protected]>>
Subject: Re: [stevengardiner/ParallelOffset_plugin] move to QGIS 3.0 with PyQt5 (#6)
Hi Adrien,
Thanks for the quick reply.
Well, it is a vector layer with polylines, that’s what really confused me. I thought about deleting the line of code that’s responsible for checking whether the layer is a vector layer or not, but I’m not sure whether this solves the problem. Also, I don’t know how to debug the plugin after changing it.
Mit freundlichen Grüßen
Fabian Kratz
[mam_logo]
Junkendiek 13
49479 Ibbenbüren
Tel +49 5451 9383730
Mobil +49 1512 0939821
[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>
www.mam-bau.com<http://www.mam-bau.com/<http://www.mam-bau.com%3chttp:/www.mam-bau.com/>>
Geschäftsführer:
Musa Hyseni
Eingetragen beim Amtsgericht Steinfurt HRA 7010
Pers.-haft Ges. MAM-Verwaltungsgesellschaft mbH
Amtsgericht Steinfurt HRB 11201
Ust.-IdNr.: DE125501852
Von: Adrien Gressin <[email protected]<mailto:[email protected]>>
Gesendet: Dienstag, 5. November 2019 20:25
An: stevengardiner/ParallelOffset_plugin <[email protected]<mailto:[email protected]>>
Cc: Fabian Kratz <[email protected]<mailto:[email protected]>>; Comment <[email protected]<mailto:[email protected]>>
Betreff: Re: [stevengardiner/ParallelOffset_plugin] move to QGIS 3.0 with PyQt5 (#6)
Hi Fabian,
You seem to use a raster layer, but you need to use vectorlayer, with at
least one polyline feature,
please make sure the active layer is your vectorlayer before to run the
plugin function "move parallel"
Best regards,
Adrien
Le mar. 5 nov. 2019 à 12:21, Eierbrot <[email protected]<mailto:[email protected]<mailto:[email protected]%3cmailto:[email protected]>>> a écrit :
Hi Adrien,
thanks a lot for the great work! I adapted all your changes and can now
use the plugin in QIS 3.10. I do, however, get an error message when trying
to run the plugin and can't seem to find a way to solve the problem. You
must know, that I hardly have any coding experience at all.
Do you know what to do to resolve this problem? Here's the error message
that I receive when trying to run the plugin:
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
Traceback (most recent call last):
File "C:/Users/fabia/AppData/Roaming/QGIS/QGIS3\profiles\Fabian
Kratz/python/plugins\ParallelOffset\paralleloffset.py", line 132, in run
for feature in layer.selectedFeatures():
AttributeError: 'QgsRasterLayer' object has no attribute 'selectedFeatures'
I hope you can help.
Thanks a lot in advance.
Fabian
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6?email_source=notifications&email_token=AAZTKCT4XVHZASDGNSUC5KDQSFJJZA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDCP45A#issuecomment-549781108>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZTKCRRW6QSFD2ARD7IAQDQSFJJZANCNFSM4E3G5GSQ>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6?email_source=notifications&email_token=ANV44DWUUALAUZ327HRO7LLQSHB7HA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDEAN6I#issuecomment-549979897>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANV44DW7QRZDDFP2WY6SXL3QSHB7HANCNFSM4E3G5GSQ>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#6?email_source=notifications&email_token=AA2HXNA7DUXQON4VNE7QJGTQSJ2THA5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDFUHDQ#issuecomment-550192014>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AA2HXNGEEWKJOT4QRNL377DQSJ2THANCNFSM4E3G5GSQ>.
*****************************************************************
Mae'r e-bost hwn ac unrhyw ffeiliau a drosglwyddir gydag ef yn gyfrinachol ac at ddefnydd yr unigolyn neu'r corff y cyfeiriwyd hwy atynt yn unig. Os ydych wedi derbyn yr e-bost hwn drwy gamgymeriad, dylech hysbysu'r gweinyddydd yn y cyfeiriad canlynol: [email protected]<mailto:[email protected]>
Bydd yr holl ohebiaeth a anfonir at y Cyngor neu ganddo yn destun cofnodi a/neu fonitro yn unol â’r ddeddfwriaeth berthnasol
Croesewir gohebiaeth yn y Gymraeg a byddwn yn ymdrin â gohebiaeth Gymraeg a Saesneg i’r un safonau ac amserlenni.
This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please notify the administrator on the following address: [email protected]<mailto:[email protected]>
All communications sent to or from the Council may be subject to recording and/or monitoring in accordance with relevant legislation
We welcome correspondence in Welsh and will deal with Welsh and English correspondence to the same standards and timescales.
*******************************************************************
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#6?email_source=notifications&email_token=ANV44DWGRWN44OQXCTM54FTQSKF65A5CNFSM4E3G5GS2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDF46DI#issuecomment-550227725>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANV44DSYGQHO7TUNDYFPD23QSKF65ANCNFSM4E3G5GSQ>.
|
Hi,
I update your code to allow using this plugin on QGIS 3.0,
I also add the possibility to create several parallel lines.
Would you push it to the QGIS plugin Repository ?
Thanks in advance,
Adrien