mpetroff / qgsazimuth

Fork of http://sourceforge.net/projects/qgsazimuth/
7 stars 3 forks source link

Azimuth and distance plugin for QGIS 2.X does not work #1

Closed giedrioks26 closed 6 years ago

giedrioks26 commented 10 years ago

Fill out your coordinates and I click on the "Draw", Writes error:

An error has occured while executing Python code:

Traceback (most recent call last): File "/home/giedrius/.qgis2/python/plugins/qgsAzimuth/qgsAzimuth.py", line 188, in addgeometry if (surveytype== 'polygonal'): UnboundLocalError: local variable 'surveytype' referenced before assignment

Python version: 2.7.3 (default, Jan 2 2013, 14:09:21) [GCC 4.7.2]

QGIS version: 2.1.0-Master Master, exported

Python path: ['/home/giedrius/.qgis2/python/plugins/processing', '/usr/share/qgis/python', u'/home/giedrius/.qgis2/python', u'/home/giedrius/.qgis2/python/plugins', '/usr/share/qgis/python/plugins', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PIL', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode', '/usr/share/qgis/python', '/home/giedrius/.qgis2/python/plugins/mmqgis/forms', '/usr/share/qgis/python/plugins/fTools/tools', '/home/giedrius/.qgis2/python/plugins/DigitizingTools/tools', '~/.qgis/python', '/media/sda4/home/giedrius/Dokumentai/qgis']

mpetroff commented 10 years ago

Do you have any segments listed in the Segment List box? I'm only able to reproduce the error with the Segment List box empty, which is still a bug, although a different bug.

giedrioks26 commented 10 years ago

When I refer azimuth and add to the Segment list, then there is no error. But this plugin always use to find the location by coordinates. It was most convenient to search for the coordinates (http://gis.stackexchange.com/a/34235/15930). Applying a point he sought to bring to the area of the territory. Do the same ZoomToCoordinates plugin, but it does not create a point. here's how to do with the 1.8 version of QGIS http://i.imgur.com/8JdgWe5.png Convenient because:

  1. finds the location
  2. puts the point
  3. zooms
  4. selected point
mpetroff commented 10 years ago

Now I understand what's going on. Previously, the plugin added features to an existing layer. When I was porting the plugin to QGIS 2.0, I ran into some issues with that and switched to using memory layers instead, which I think makes more sense. At the time, I didn't realize the plugin also worked with point and polygon layers, as I had only ever used it with line layers. I need to add a layer type option to the plugin to restore that functionality, as the plugin currently only generates line layers.

mewoch commented 10 years ago

There's also been discussion on the qgis-user list : http://osgeo-org.1560.x6.nabble.com/Azimuth-and-distance-plugin-for-QGIS-2-X-td5097302.html

I'd not noticed it was only doing lines.

I can see a use for the zoom feature, but wondered if this was something you saw as important to this plugin, or whether what giedrioks26 was trying to achieve might be better served by a new/different plugin?

mpetroff commented 6 years ago

I think this was fixed in v0.9.2.