Asratum / KP_find

KP Find QGIS Plugin
GNU General Public License v2.0
6 stars 0 forks source link

Unable to Run QGIS 3.14.15 #10

Open tristenbarrett opened 3 years ago

tristenbarrett commented 3 years ago

Since downloading this very useful sounding plugin we have been unable to get it working.

Stack Trace when using either tool shows:


UnboundLocalError: local variable 'ptCP84' referenced before assignment Traceback (most recent call last): File "C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\KP_find\KP_Find.py", line 212, in Kp4Points new_ptLayer =self.mapTool.KP_Iterate_pts(lnLayer, ptLayer) #function to iterate over points, calls other functions in it File "C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\KP_find\kpTool.py", line 256, in KP_Iterate_pts kp_dist = self.measureLineGeod(linetoMeasurekp4p, point_of) #run measurements File "C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\KP_find\kpTool.py", line 170, in measureLineGeod proj_pt, dist_ext = self.closestPt(linetoMeasure, clicked_pt, True) #we'll need that point later to compare with projected points of subsegments File "C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\KP_find\kpTool.py", line 155, in closestPt geod_ds = KPTool.geod.Inverse(ptCP84.y(), ptCP84.x(), ptPP84.y(), ptPP84.x()) UnboundLocalError: local variable 'ptCP84' referenced before assignment

Python version: 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] QGIS version: 3.14.15-Pi Pi, d5114d2cfa

Python Path: C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins C:/PROGRA~1/QGIS3~1.14/apps/qgis/./python/plugins C:\PROGRA~1\QGIS3~1.14\apps\Python37 C:\PROGRA~1\QGIS3~1.14\apps\Python37\Scripts C:\Program Files\QGIS 3.14\bin\python37.zip C:\PROGRA~1\QGIS3~1.14\apps\Python37\DLLs C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib C:\Program Files\QGIS 3.14\bin C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\win32 C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\win32\lib C:\PROGRA~1\QGIS3~1.14\apps\Python37\lib\site-packages\Pythonwin C:/Users/Tristen Barrett/AppData/Roaming/QGIS/QGIS3\profiles\default/python C:\Users\Tristen Barrett\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\KP_find\ext-libs C:/Dropbox/QGIS

Asratum commented 3 years ago

Thanks for reporting this, this bug seems to occur when you are using a geographical system, usually WGS84 (EPSG: 4326). Try to convert your line layer to a UTM projection and set the project to that UTM projection as well; then it should work.

tristenbarrett commented 3 years ago

Thanks for reporting this, this bug seems to occur when you are using a geographical system, usually WGS84 (EPSG: 4326). Try to convert your line layer to a UTM projection and set the project to that UTM projection as well; then it should work.

Many thanks for the reply. Our project is entirely in projected, including the layer in question, however it is a rather unusual custom geodesy so I'll have a go with a more standard UTM and let you know the outcome.

Asratum commented 3 years ago

Could you let me know if the plugin worked in the standard UTM projection for you guys? If you send me a file in your custom CRS I could also take a look at it - it seems strange that you were getting the WGS84 geographical bug in a projected layer.