Code Monkey home page Code Monkey logo

qgis-contour-plugin's People

Contributors

cboone avatar ccrook avatar jagodki avatar timclicks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qgis-contour-plugin's Issues

ContourGenerator throws exception for NULL values

I have a data source i really don't want to remove the NULL values from. Using a filter or a selection to remove them virtually, I cannot use the contour plugin. When i select the field that has the NULL values for the data value the plugin throws an exception.

I edited line 290 in ContourGenerator.py to read:

zval=float(zval or 0.0)

Not sure if that's the best approach but it solved my immediate problem

Wrong contour lines with QGIS 3.34.6

I'm using the contour plugin for many years always with the same parameters.
Since QGIS 3.34.6 I got wrong contour lines.

Point-Dataset: HP3.gpkg, Field with Z-Value: "Höhe"
HP3.zip

Result with QGIS 3.34.6: HP3_Contours_wrong.gpkg (file size exceeds upload-limit)
image
image

Result with QGIS 3.34.5 and earlier: HP3_Contours_ok.gpkg (file size exceeds upload-limit)
image
image

Parameters for contour line [calculation:]
image

window size

Hi,

the last update seems to contain some GUI changes too. The window is larger then my screen (MBP Mid 2010). The buttons at the bottom are reachable (more or less), but the QgsMessageBar implemented in the plugin-GUI is not readable for me. Maybe it would be better to implement a scroll view, so that the window size could be reduced?

Sincerely,
Christoph
bildschirmfoto 2018-06-24 um 12 25 35

Filled Contour Polygons could fail for certain data value maximum

When calling the contour plugin from the qgis toolbox there are issues trying to create filled polygons for certain attributes in a shapefile. The created Output will have holes where no class/polygon is created.
grafik

Certain classes couldn't be generated and the log shows that Features could not get written to the output.
grafik

It happens no matter how many classes are chosen or what method for the contour level calculation is chosen. Also it has no effect to change whether contours are extended up or below max and min.

It might also not be related to amount of points since it does work for certain attributes while it does not work for others in the same shapefile. It also does not matter if the attributes data type is real or integer.

It does work though if instead of filled contour polygons only contour lines are created.

If the creation fails as mentioned above the workaround is to set the MaxContourValue by hand. If you do set the value to the data maximum it still fails, but if you set it slightly above or below the data maximum then all classes are generated (of course classes are then slightly off maximum as well).

My test data set has a data maximum of 6.5 which made the algorithm to fail when MinimumContourValue and MaximumContourValue are omitted so that min and max are calculated from the attribute. When manually set MaxContourValue to 6.5 it also fails (it also fails for 6.7/6.9). Setting MaxContourValue to 6.4/6.6/6.8 or 6.500001 made the algorithm to work as expected.
Interestingly, directly changing the data value of one of the data points to a specific value (that works if chosen for MaxContourValue for example 6.6) does seem to work without the need to adjust MaxContourValue manually to be slighty off the data maximum.
However, changing one former maximum data point value from 6.5 to 6.6 makes the algorithm to work but changing a lot of the points to 6.6 made the algorithm to fail again. I suspect that not one value leads to problems here but the mixture of values and that it might be related to some problems during classification or min/max/range calculation maybe due to some rounding or trimming of values.

Since I'm not able to investigate further into the plugins code I can only provide my test data set

I've tested on two different Win10 machines with QGIS 3.6.2-Noosa, 3.10.2-A Coruña and 3.10.3-A Coruña with the recent version of the plugin.
test_data_set.zip

Contour Labels show the wrong elevation.

image

I set up UTM 15 in US feet and contoured an area shown on link above. Contours look good. However, the labels show the wrong elevations (grossly wrong). I change to map units, and the numbers are still wrong. Used the profile plugin to verify contours are correct, but labels are wrong. This is a major problem.

Contour Plugin Processing Algorithm not detected in Standalone Script

I followed this script. I was successfully imported the processing algorithms but when I list the algorithms using print(QgsApplication.processingRegistry().algorithms()), contour plugin is not listed there (but it listed I tried it in QGIS Python Console) . Is it because it an experimental plugin?

This is what my code looks:

sys.path.append('/usr/share/qgis/python/plugins')
import processing
from processing.core.Processing import Processing
Processing.initialize()

print(QgsApplication.processingRegistry().algorithms())

I use QGIS 3 on Ubuntu 18

"Exception Struck: 735" Issues with larger datasets

When working with datasets of only ~500 points, the plugin works great. I'm having trouble when importing data consisting of over ~1000 points. I get the exception struck error, then:

An error has occured while executing Python code:

Traceback (most recent call last):
File "C:/Users/WRCAdmin/.qgis2/python/plugins\contour\contour.py", line 369, in accept
self.makeContours()
File "C:/Users/WRCAdmin/.qgis2/python/plugins\contour\contour.py", line 579, in makeContours
lines = self.computeContours()
File "C:/Users/WRCAdmin/.qgis2/python/plugins\contour\contour.py", line 623, in computeContours
cs = plt.tricontour(x, y, z, levels, extend=extend)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\pyplot.py", line 3242, in tricontour
ret = ax.tricontour(_args, *_kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\axes.py", line 9185, in tricontour
return mtri.tricontour(self, _args, *_kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 280, in tricontour
return TriContourSet(ax, _args, *_kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 36, in init
ContourSet.init(self, ax, _args, *_kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\contour.py", line 860, in init
self._process_args(_args, *_kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 47, in _process_args
tri, z = self._contour_args(args, kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 82, in _contour_args
Triangulation.get_from_args_and_kwargs(_args, *_kwargs)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\tri\triangulation.py", line 168, in get_from_args_and_kwargs
triangulation = Triangulation(x, y, triangles, mask)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\tri\triangulation.py", line 55, in init
dt = delaunay.Triangulation(self.x, self.y)
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\delaunay\triangulate.py", line 124, in init
self.hull = self._compute_convex_hull()
File "C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\matplotlib\delaunay\triangulate.py", line 160, in _compute_convex_hull
hull.append(edges.pop(hull[-1]))
KeyError: 735

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.2.0-Valmiera Valmiera, c3a2817

Python path: ['C:/PROGRA1/QGISVA1/apps/qgis/./python/plugins\processing', 'C:/PROGRA1/QGISVA1/apps/qgis/./python', u'C:/Users/WRCAdmin/.qgis2/python', u'C:/Users/WRCAdmin/.qgis2/python/plugins', 'C:/PROGRA1/QGISVA1/apps/qgis/./python/plugins', 'C:\PROGRA1\QGISVA1\bin\python27.zip', 'C:\PROGRA1\QGISVA1\apps\Python27\DLLs', 'C:\PROGRA1\QGISVA1\apps\Python27\lib', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\plat-win', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\lib-tk', 'C:\PROGRA1\QGISVA1\bin', 'C:\PROGRA1\QGISVA1\apps\Python27', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\Shapely-1.2.18-py2.7-win-amd64.egg', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\six-1.3.0-py2.7.egg', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\xlrd-0.9.2-py2.7.egg', 'C:\PROGRA1\QGISVA1\apps\Python27\lib\site-packages\xlwt-0.7.5-py2.7.egg', 'C:\PROGRA1\QGISVA1\apps\qgis\python\plugins\fTools\tools']

plugin crshes when i use Preference / Options

Hello,
I'm using QGIS 3.4.4 with Windows.
Versions : matplotlib 3.0.0, numpy 1.15.4, Pyhton 3.7.0

When the plugin is active and I go to Preferences / Options and then validate options, Qgis crashes with 2 messages :

  • RuntimeError: wrapped C/C++ object of type ContourGenratorAlgorithm has been deleted
    File "C:\Program Files\Qgis 3.4\profiles\default\python/plugins\contour\ContourGenratorProvider.py", line 55, in loadAlgorithms
    self.addAlgorythm( alg)
  • Qgis Crashed

Thanks

Gaps in filled contours

Comment from plugin maintainer

This is a frequently encountered issue. I think it mainly (exclusively) applies when the contouring is using triangulation. If the data appears to fall on a regular grid the plugin will contour using a grid rather than triangulation, which appears to work reliably.

The problem appears to be that matplotlib library generating the filled contours can create invalid geometries, particularly when the edges of the triangulated area are straight.

As yet I haven't developed a fix or workaround for this


I had generated a contour plot based on shape file point values, using N-equal-intervals with 18 intervals, other options set to automatic. I then decided to add a dummy point at a lower interval to give the contours sensible interval boundaries (the "set" option was not working).

When I then add again, the process appears to complete, However, the following results:

image

In addition, the scratch layer appears to be in "edit" mode. I cannot close the edit mode as there are commit errors (when selecting save):

image

I have tried reinstalling QGIS (now in 3.12.2), removing and reinstalling the plugin, copying and reimporting my shapefile, all with no success.

I have tried reducing the number of intervals to 10, and I still end up with areas missing from the image:

image

Please assist if you can! Is there a cache somewhere that needs clearing? I apologise in advance for my lack of coding knowledge and the very basic reporting of my issue!

can't load plugin 1.1.0 on master 2.5

when executing QGIs master with Contour plugin enabled, I got an error message relative to a lack of a module named "rrule". All work on QGIS 2.4.

Impossible de charger l'extension contour provoque une erreur lors de l'appel de sa méthode classFactory()

Traceback (most recent call last):
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 204, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/harrissou/.qgis2/python/plugins\contour__init__.py", line 47, in classFactory
from contour import Contour
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/harrissou/.qgis2/python/plugins\contour\contour.py", line 39, in
import matplotlib.pyplot as plt
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\matplotlib\pyplot.py", line 26, in
from matplotlib.figure import Figure, figaspect
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\matplotlib\figure.py", line 36, in
from matplotlib.axes import Axes, SubplotBase, subplot_class_factory
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\matplotlib\axes.py", line 19, in
import matplotlib.dates as _ # File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\matplotlib\dates.py", line 122, in
from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY,
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 454, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: No module named rrule

Version de Python :
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

Version de QGIS :
2.5.0-Master Master, d0e9d8d

python command document

Hello I want to use contour plugin using python script.
is there any documents?

My plan is to make a contour line by custom levels with both line and filled.

Thanks.

r=processing.run( "contourplugin:generatecontours", { #'ContourInterval' : 1, #for KM/h #'ContourLevels' : '0.1 0.7 1.4 2.2 2.9 3.6 5.4 7.2 9.0 11 13 14 16 18 20 22 23 25 29 32 36 54 72 90 108 126 144 162 180 198 216', 'ContourMethod' : 3, #for m/s 'ContourLevels' : '[0.0 0.2 0.4 0.6 0.8 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 8.0 9.0 10 15 20 25 30 35 40 45 50 55 60]', #'ContourLevels' : '0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60', 'ContourType' : 2, 'ExtendOption' : 0, 'InputField' : '"VAL"', 'InputLayer' : layer, 'LabelTrimZeros' : False, 'LabelUnits' : '', 'MaxContourValue' : None, 'MinContourValue' : None, 'NContour' : 200, 'OutputLayer' : 'memory:' } )

Exception struck: 10588

hello,

I try to use Contour but i have the error Exception struck: 10588.

Can you help me please?
Thanx !

Filled counters still have contour lines

Hey guys, your plugin is great and I really like it. However I'm having one issue which is that even when I select "filled contours" when creating the contour layer, I still get all the contour lines along the boundaries just like when selecting "contour lines". This makes it hard to view the data.

Blank polygon generated

Hello, I made a filled contour polygons with user selected contour levels, but there are some blank polygons...
can you tell me how to resolve it?

===========Here is a log ==============
`QGIS 버전: 3.12.3-București
QGIS 코드 리비전: 8234261527
Qt 버전: 5.11.2
GDAL 버전: 3.0.4
GEOS 버전: 3.8.1-CAPI-1.13.3
PROJ 버전: Rel. 6.3.2, May 1st, 2020
알고리즘 처리 중...
'Generate Contours' 알고리즘 시작…
입력 파라미터:
{ 'ContourInterval' : 0, 'ContourLevels' : '0.1 0.7 1.4 2.2 2.9 3.6 5.4 7.2 9.0 11 13 14 16 18 20 22 23 25 29 32 36 54 72 90 108 126 144 162 180 198 216', 'ContourMethod' : 4, 'ContourType' : 1, 'DuplicatePointTolerance' : None, 'ExtendOption' : 0, 'InputField' : '"VAL_KM"', 'InputLayer' : 'C:\Users\peter\Documents\testshape.shp|layername=testshape', 'LabelDecimalPlaces' : 1, 'LabelTrimZeros' : False, 'LabelUnits' : 'kmh', 'MaxContourValue' : 216, 'MinContourValue' : 0.1, 'NContour' : 500, 'OutputLayer' : 'TEMPORARY_OUTPUT' }

Triangulating 701 points
Contouring 1392 triangles
객체를 Output_layer_9ba0b41c_c170_416b_9de5_a87117ba7c18에 쓸 수 없습니다
객체를 Output_layer_9ba0b41c_c170_416b_9de5_a87117ba7c18에 쓸 수 없습니다
0.35 초만에 실행을 완료했습니다
결과:
{'OutputLayer': 'Output_layer_9ba0b41c_c170_416b_9de5_a87117ba7c18'}

출력 레이어 불러오기
'Generate Contours' 알고리즘을 처리했습니다`

response_wind_.zip
qgis

maximum count of contours

Hi Chris,

I have another question relating to your plugin ^^. During processing I received the message, that the plugin cannot create more than 20 contours per layer/dataset. Is this a limitation of matplotlib or can you control this in the source code?

Sincerely,
Christoph

Negative values not represented

I'm trying to create water level contours with values ranging from -6m to 30m.
The countours created starts only from 0m.
I'm using QGIS 2.4.0.
Thanks

Contour is not filling at larger scales

Hi,

I'm running qgis 2.14.0 on ubuntu; python 2.7.6;

I'm using the contour plugin on a 26k point geojson file.

After running the contour plugin on the file, the contours all display properly at a small scales (1:70,000).
However, when I zoom into a larger scale, many of the contours are not displayed.

I've attached a couple screenshots as an example.
selection_043
selection_042

Let me know if you'd like any other information.

Here's the python log from qgis: https://gist.github.com/skorasaurus/e806d576c9141eb677ad

Contour Plugin generated contours do not have enough nodes

I am using the contour plugin to generate intermediate contours. I have a vector file with 5 foot contours and want to interpolate 1 foot contours from it. The procedure I used was:

  1. Extract nodes from my 5 foot contours vector file.
    original-5-ft-contours
    nodes-from-original-5-ft-contours
  2. Create intermediate contours from nodes extracted from original 5 foot contours.
    intermediate-contours-from-contours-plugin
  3. Nodes from intermediate contours.
    nodes-of-intermediate-contours-from-contours-plugin

The problem is that the intermediate contours are not very good in some of the open areas. I assume that this is due to the nodes of the intermediate contours the open areas are too far apart.

Is there a way to get the contour plugin to generate more nodes in these open areas to make the generated intermediate contours in these open areas better?

Plugin doesn't create first contour

contour_example

I have an irregular grid of points, each with a value that ranges from 100 to almost 17000. The plugin window shows the list of contours it will create, which includes 100. But, the 100 contour is not created. Is there something I'm missing in the settings?

Contour is no more working fine october 2017 ? any other plugin to do the stuff ?

On windows with Qgis 2.14 and 2.18, contour begins to draw something (lines are angular, not smooth like before), but the progress bar stops at 30%.
After closing the box and saving the project, the lines does not appear anymore when loading again (lines was not saved).

It's very disapointing since I didn't found any other plugin to do the job.

Option "Fixed contour interval" crashes in QGIS 3

Steps to reproduce:

  • Add delimited text in QGIS
  • Open Contour plugin
  • The delimited-text layer is selected as input, now pick the Data value ("field_3" in my case)
  • (the plugin calculates the predefined values)
  • In "contouring" switch to "Fixed contour interval"

The plugin crashes immediately after.
When the error message is dismissed, the running of both QGIS and Contour plugin continues seamlessly.

System info:
Contour plugin 2.0.1
QGIS 3.0.3
Windows 10 (v. 1803)

The error message:

NameError: name 'self' is not defined 
Traceback (most recent call last):
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourDialog.py", line 506, in computeLevels
    self.showLevels()
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourDialog.py", line 512, in showLevels
    levels=self._generator.levels()
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGenerator.py", line 366, in levels
    self._levels=ContourMethod.calculateLevels(z,method,**params)
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourMethod.py", line 204, in calculateLevels
    return m.calc(z,**params)
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourMethod.py", line 100, in 
    func=lambda z,**kwa: _methodFunc(z,f,name,req,opt,kwa)
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourMethod.py", line 80, in _methodFunc
    return _sortedLevels(f(z,*pav,**kwv))
  File "C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourMethod.py", line 186, in calcIntervalContours
    .format(nmax-nmin,self.MaxContours))
NameError: name 'self' is not defined


Verze Pythonu: 3.6.0 (v3.6.0:41df79263a11, Dec 23 2016, 08:06:12) [MSC v.1900 64 bit (AMD64)] 
QGIS verze: 3.0.3-Girona Girona, 8a899c8758 

Python cesta:
C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour
C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python
C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins
C:\PROGRA~1\QGIS3~1.0\bin\python36.zip
C:\PROGRA~1\QGIS3~1.0\apps\Python36\DLLs
C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib
C:\PROGRA~1\QGIS3~1.0\bin
C:\PROGRA~1\QGIS3~1.0\apps\Python36
C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages
C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\win32
C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS3~1.0\apps\Python36\lib\site-packages\Pythonwin
C:/Users/ja/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Alles/works/maps/vizka/podkl

Contouring irregular points misses points

There appears to be an issue/feature in matplotlib triangulation which causes it to miss large numbers of points where then data are far from the origin. Example data set and matplotlib script attached. Attached image is using matplotlib version 1.5.1. Apparently not an issue in 1.3.1

Workaround for the contour plugin is to translate the data to the origin before contouring. Not sure when this will work and when not.

Reported in matplotlib/matplotlib#8842

tricont.zip
tricont

Key Error: 4604

I get the with the following lines:

An error has occured while executing Python code:

Traceback (most recent call last):
File "D:\Documents and Settings\tr32014/.qgis2/python/plugins\contour\contour.py", line 373, in accept
self.makeFilledContours()
File "D:\Documents and Settings\tr32014/.qgis2/python/plugins\contour\contour.py", line 584, in makeFilledContours
polygons = self.computeFilledContours( asLayers )
File "D:\Documents and Settings\tr32014/.qgis2/python/plugins\contour\contour.py", line 651, in computeFilledContours
self._computeFilledContoursForLevel(levels,extend,polygons)
File "D:\Documents and Settings\tr32014/.qgis2/python/plugins\contour\contour.py", line 658, in _computeFilledContoursForLevel
cs = plt.tricontourf(x, y, z, levels, extend=extend)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\pyplot.py", line 3108, in tricontourf
ret = ax.tricontourf(_args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\axes.py", line 8926, in tricontourf
return mtri.tricontourf(self, _args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 287, in tricontourf
return TriContourSet(ax, _args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 36, in init
ContourSet.init(self, ax, _args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\contour.py", line 780, in init
self._process_args(_args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 47, in _process_args
tri, z = self._contour_args(args, kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 82, in _contour_args
Triangulation.get_from_args_and_kwargs(_args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\triangulation.py", line 172, in get_from_args_and_kwargs
triangulation = Triangulation(x, y, triangles, mask)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\triangulation.py", line 72, in init
dt = delaunay.Triangulation(self.x, self.y)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\delaunay\triangulate.py", line 123, in init
self.hull = self._compute_convex_hull()
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\delaunay\triangulate.py", line 158, in _compute_convex_hull
hull.append(edges.pop(hull[-1]))
KeyError: 4604

Python version:
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.0.1-Dufour Dufour, ebebdf3

Python path: ['C:/PROGRA1/QGISDU1/apps/qgis/./python/plugins\processing', 'C:/PROGRA1/QGISDU1/apps/qgis/./python', 'D:\Documents and Settings\tr32014/.qgis2/python', 'D:\Documents and Settings\tr32014/.qgis2/python/plugins', 'C:/PROGRA1/QGISDU1/apps/qgis/./python/plugins', 'C:\PROGRA1\QGISDU1\bin\python27.zip', 'C:\PROGRA1\QGISDU1\apps\Python27\DLLs', 'C:\PROGRA1\QGISDU1\apps\Python27\lib', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\plat-win', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\lib-tk', 'C:\PROGRA1\QGISDU1\bin', 'C:\PROGRA1\QGISDU1\apps\Python27', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'D:\Documents and Settings\tr32014.qgis2\python\plugins\mmqgis/forms', 'C:\PROGRA1\QGISDU1\apps\qgis\python\plugins\fTools\tools']

create non-memory layer with processing plugin

Hi Chris,

I have a problem using your plugin with the processing framework (the problem occurs using the processing plugin too). If I want to create a memory layer, the processing plugin works fine. But export the processing result to the filesystem will not work (I tried the file types Geopackage, GeoJSON and GML - all with the same problem). After the processing the protocol contains the hint, that the features cannot be written to the layer (see the screenshot below - but it is in German, sorry for that ^^'). The triangulation and the contouring should work, just the export to a layer directly to the filesystem is not working. The problem just occurs when I try to create a polygon layer (i.e. filled contours and layer polygons) - LineStrings can be exported into the named formats without problems.
When I create polygons in a memory layer, the fields for [expression/field]_min and [expression/field]_max have the value 0.0 for each feature (see the next screenshot below). But the label field contains correct values. Because all three fields depends on the same variables in the ContourGenerator-class (that what I saw, maybe I didn't analyze the code correctly), it seems that there might be a problem with adding the features to the layer. I have not many experience with the QgsFeatureSink-class, maybe there is a problem? I tried to print attributes of the features to the python console (to check whether the features have correct values before exporting to the filesystem), but then QGIS crashes every time. That is very unusual, with my own plugins I can print each feature, layer etc. in big loops without crashing QGIS - maybe another problem?

Short conclusion:

  • processing plugin cannot export polygons to the filesystem, but memory layer works fine
  • the features cannot be written to the layer - fields and CRS of the layer/file are correct and can be set
  • the fields [expression/field]_min and [expression/field]_max of filled polygons have not correct values (0.0 for each feature)
  • I am not able to reach or print the features during the processing (tried in ContourGenerator and ContourGeneratorAlgorithm) - QGIS will crash every time

Information about my system:

  • MacBook Pro Mid 2010
  • OS: macOS 10.13.5
  • QGIS: v3.2.0 (Bonn)
  • Contour-Plugin: v2.0.5

Let me know, if you need additional information from me about this problem (maybe the data I used or a complete description for reproducing the bug).

Sincerely,
Christoph

P.S. and now the Screenshots :)

Protocol with the information, that the features cannot be written to the layer:
bildschirmfoto 2018-07-05 um 06 16 21

The attribute table with incorrect values:
bildschirmfoto 2018-07-02 um 05 49 30

QGIS 3 implementation crashes QGIS in ubuntu nightly

Contour plugin rebuilt for QGIS3 in qgis3 branch, but currently crashes when contouring irregular (non-gridded) data in ubuntu. Seems to work ok in windows.

Have released as experimental as still valuable for gridded contouring and in Windows.

Crash occurs in calculating convex hull as preliminary to forming triangulation. Occurs on ubuntu 16.04 with matplotlib version 1.5.1 and ubuntu 17.10 with matplotlib version 2.0.0. gdb trace output on 16.04 with nightly ubuntugis distribution follows:

Thread 1 "qgis.bin" received signal SIGSEGV, Segmentation fault.
0x00007fff4f7ca098 in qh_initstatistics ()
   from /usr/lib/python3/dist-packages/matplotlib/_qhull.cpython-35m-x86_64-linux-gnu.so
#0  0x00007fff4f7ca098 in qh_initstatistics ()
   from /usr/lib/python3/dist-packages/matplotlib/_qhull.cpython-35m-x86_64-linux-gnu.so
#1  0x00007fff4f7c6f82 in qh_initqhull_start ()
   from /usr/lib/python3/dist-packages/matplotlib/_qhull.cpython-35m-x86_64-linux-gnu.so
#2  0x00007fff4f7d12bc in qh_new_qhull ()
   from /usr/lib/python3/dist-packages/matplotlib/_qhull.cpython-35m-x86_64-linux-gnu.so
#3  0x00007fff4f7a3821 in ?? ()
   from /usr/lib/python3/dist-packages/matplotlib/_qhull.cpython-35m-x86_64-linux-gnu.so
#4  0x00007fff5d977039 in PyCFunction_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#5  0x00007fff5da831b5 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#6  0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#7  0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#8  0x00007fff5d99bad8 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#9  0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#10 0x00007fff5daeeaec in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#11 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#12 0x00007fff5d946f19 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#13 0x00007fff5d959fe6 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#14 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#15 0x00007fff5da7d92f in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#16 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#17 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#18 0x00007fff5d99bbd5 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#19 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#20 0x00007fff5da7e9eb in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#21 0x00007fff5da83639 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#22 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#23 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#24 0x00007fff5d99bbd5 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#25 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#26 0x00007fff5da7e9eb in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#27 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#28 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#29 0x00007fff5d99bbd5 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#30 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#31 0x00007fff5da7e9eb in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#32 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#33 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#34 0x00007fff5d99bbd5 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#35 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#36 0x00007fff5daeeaec in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#37 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#38 0x00007fff5d946f19 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#39 0x00007fff5d959fe6 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#40 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#41 0x00007fff5da7e9eb in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#42 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#43 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#44 0x00007fff5d99bbd5 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#45 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#46 0x00007fff5da7e9eb in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#47 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#48 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#49 0x00007fff5d99bbd5 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#50 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#51 0x00007fff5da7e9eb in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#52 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#53 0x00007fff5da81f39 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#54 0x00007fff5da83639 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#55 0x00007fff5da83639 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#56 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#57 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#58 0x00007fff5d99bad8 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#59 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#60 0x00007fff5daeeaec in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#61 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#62 0x00007fff5db12937 in PyEval_CallObjectWithKeywords ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#63 0x00007fff5cfc5d00 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#64 0x00007fff5cfc6178 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#65 0x00007fff5cfbc2b0 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#66 0x00007fff5cfbcbe7 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#67 0x00007ffff4d0eee0 in QMetaObject::activate(QObject*, int, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#68 0x00007ffff596d2b2 in QAbstractButton::clicked(bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#69 0x00007ffff56cff44 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#70 0x00007ffff56d1559 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#71 0x00007ffff56d16d4 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#72 0x00007fff563b028b in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-35m-x86_64-linux-gnu.so
#73 0x00007ffff5615fc8 in QWidget::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#74 0x00007fff563b208b in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-35m-x86_64-linux-gnu.so
#75 0x00007ffff55d305c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#76 0x00007ffff55d8c19 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#77 0x00007ffff611fff1 in QgsApplication::notify (this=0x7fffffffda80, 
    receiver=0x55555950f720, event=0x7fffffffb0d0)
    at ../../src/core/qgsapplication.cpp:317
#78 0x00007ffff4ce038b in QCoreApplication::notifyInternal(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#79 0x00007ffff55d7b32 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#80 0x00007ffff56305bb in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#81 0x00007ffff5632b7b in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#82 0x00007ffff55d305c in QApplicationPrivate::notify_helper(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#83 0x00007ffff55d8516 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#84 0x00007ffff611fff1 in QgsApplication::notify (this=0x7fffffffda80, 
    receiver=0x55555912c540, event=0x7fffffffb580)
    at ../../src/core/qgsapplication.cpp:317
#85 0x00007ffff4ce038b in QCoreApplication::notifyInternal(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#86 0x00007ffff50224e1 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#87 0x00007ffff50241a5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#88 0x00007ffff5007f08 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#89 0x00007fffd35dc200 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#90 0x00007fffec859197 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#91 0x00007fffec8593f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#92 0x00007fffec85949c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#93 0x00007ffff4d367cf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#94 0x00007ffff4cddb4a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#95 0x00007ffff57cdd8d in QDialog::exec() ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#96 0x00007fff5639989d in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtWidgets.cpython-35m-x86_64-linux-gnu.so
#97 0x00007fff5d977039 in PyCFunction_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#98 0x00007fff5da831b5 in PyEval_EvalFrameEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#99 0x00007fff5db13cac in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#100 0x00007fff5db13d83 in PyEval_EvalCodeEx ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#101 0x00007fff5d99bad8 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#102 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#103 0x00007fff5daeeaec in ?? ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#104 0x00007fff5da5054e in PyObject_Call ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#105 0x00007fff5db12937 in PyEval_CallObjectWithKeywords ()
   from /usr/lib/x86_64-linux-gnu/libpython3.5m.so.1.0
#106 0x00007fff5cfc5d00 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#107 0x00007fff5cfc6178 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#108 0x00007fff5cfbc2b0 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#109 0x00007fff5cfbcbe7 in ?? ()
   from /usr/lib/python3/dist-packages/PyQt5/QtCore.cpython-35m-x86_64-linux-gnu.so
#110 0x00007ffff4d0eee0 in QMetaObject::activate(QObject*, int, int, void**) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#111 0x00007ffff55c9412 in QAction::triggered(bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#112 0x00007ffff55cb898 in QAction::activate(QAction::ActionEvent) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#113 0x00007ffff56d15a0 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#114 0x00007ffff56d16d4 in QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#115 0x00007ffff579626a in QToolButton::mouseReleaseEvent(QMouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#116 0x00007ffff5615fc8 in QWidget::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#117 0x00007ffff5796349 in QToolButton::event(QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#118 0x00007ffff55d305c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#119 0x00007ffff55d8c19 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#120 0x00007ffff611fff1 in QgsApplication::notify (this=0x7fffffffda80, 
    receiver=0x555557aa4ef0, event=0x7fffffffc5a0)
    at ../../src/core/qgsapplication.cpp:317
#121 0x00007ffff4ce038b in QCoreApplication::notifyInternal(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#122 0x00007ffff55d7b32 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#123 0x00007ffff56305bb in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#124 0x00007ffff5632b7b in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#125 0x00007ffff55d305c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#126 0x00007ffff55d8516 in QApplication::notify(QObject*, QEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5
#127 0x00007ffff611fff1 in QgsApplication::notify (this=0x7fffffffda80, 
    receiver=0x555555e5d530, event=0x7fffffffca50)
    at ../../src/core/qgsapplication.cpp:317
#128 0x00007ffff4ce038b in QCoreApplication::notifyInternal(QObject*, QEvent*)
    () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#129 0x00007ffff50224e1 in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#130 0x00007ffff50241a5 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#131 0x00007ffff5007f08 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5
#132 0x00007fffd35dc200 in ?? ()
   from /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5
#133 0x00007fffec859197 in g_main_context_dispatch ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#134 0x00007fffec8593f0 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#135 0x00007fffec85949c in g_main_context_iteration ()
   from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#136 0x00007ffff4d367cf in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#137 0x00007ffff4cddb4a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#138 0x00007ffff4ce5bec in QCoreApplication::exec() ()
   from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#139 0x00005555555678b1 in main (argc=1, argv=0x7fffffffdf68)
    at ../../src/app/main.cpp:1431

Error occurs in python line

            cs = plt.tricontour(x, y, z, levels, extend=extend)

Note that dumping x,y,z,levels with np.save and then running tricontour in a simple test programs runs without error, so in some way the error relates to the QGIS environment.

Comment from Ben Root (on matplotlib-users list):

Looks like a conflict for the qhull library, which matplotlib vendors and builds as a part of its packaging. How did qgis and matplotlib get installed? Perhaps they were built with conflicting flags, perhaps? Just a few ideas off of the top of my head.

Extend options don't work on windows

The option to manually enter intervals does not appear when you press the right button as described in the documentation.
qgis 3.32.3
Windows 11 x64

u'\xe4'

Hi,

I get the following error message:

Traceback (most recent call last):
File "C:/Users/Mathias/.qgis2/python/plugins\contour\contour.py", line 476, in accept
self.makeContours()
File "C:/Users/Mathias/.qgis2/python/plugins\contour\contour.py", line 677, in makeContours
clayer = self.buildContourLayer(lines)
File "C:/Users/Mathias/.qgis2/python/plugins\contour\contour.py", line 889, in buildContourLayer
name = "%s"%str(self.uOutputName.text())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe4' in position 22: ordinal not in range(128)

Python-Version:
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS-Version:
2.6.0-Brighton Brighton, exported

u'\xe4' means the German "ä".

The data-layer do not have any "ä" nor in the field names nether in the data.

What can I do to run your plugin?

Thanks and best Regards

Mathias

Invalid value for ContourMethod

Problem Description
The Generate Contours plugin fails with a value error, seemingly related to ContourMethod.

QGIS Version Information

QGIS version 3.10.2-A Coruña QGIS code revision d4cd3cfe5a
Compiled against Qt 5.11.2 Running against Qt 5.11.2
Compiled against GDAL/OGR 3.0.3 Running against GDAL/OGR 3.0.3
Compiled against GEOS 3.8.0-CAPI-1.13.1 Running against GEOS 3.8.0-CAPI-1.13.1
Compiled against SQLite 3.29.0 Running against SQLite 3.29.0
PostgreSQL Client Version 11.5 SpatiaLite Version 4.3.0
QWT Version 6.1.3 QScintilla2 Version 2.10.8
Compiled against PROJ 6.3.0 Running against PROJ Rel. 6.3.0, January 1st, 2020
OS Version Windows 10 (10.0)
Active python plugins CalculateGeometry; guided_offline_editing; MemoryLayerSaver; networks; openlayers_plugin; ORStools; PeliasGeocoding; PluginLoadTimes; realcentroid; snail; SpreadsheetLayers; zoom_level; db_manager; MetaSearch; processing; contour

Generate Controus - Log

Algorithm 'Generate Contours' starting…
Input parameters:
{ 'ContourInterval' : None, 'ContourLevels' : '', 'ContourMethod' : None, 'ContourType' : 0, 'DuplicatePointTolerance' : None, 'ExtendOption' : None, 'InputField' : '\"ELEVATION\"', 'InputLayer' : 'C:\\Users\\username\\Desktop\\survey_points.gpkg|layername=Simplified', 'LabelDecimalPlaces' : None, 'LabelTrimZeros' : False, 'LabelUnits' : '', 'MaxContourValue' : None, 'MinContourValue' : None, 'NContour' : None, 'OutputLayer' : 'TEMPORARY_OUTPUT' }

Traceback (most recent call last):
File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 116, in _getEnumValue
id=values[int(id)]
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 277, in processAlgorithm
method = self._getEnumValue( parameters, self.PrmContourMethod, context )
File "C:/Users/username/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 119, in _getEnumValue
tr('Invalid value {0} for {1}').format(id,name))
contour.ContourGeneratorAlgorithm.ContourGeneratorAlgorithmError: Invalid value for ContourMethod

Execution failed after 0.01 seconds

Loading resulting layers
Algorithm 'Generate Contours' finished

Processing History - Generate Contours Entry
processing.run("contourplugin:generatecontours", {'InputLayer':'C:\\Users\\username\\Desktop\\survey_points.gpkg|layername=Simplified','InputField':'\"ELEVATION\"','DuplicatePointTolerance':None,'ContourType':0,'ExtendOption':None,'ContourMethod':None,'NContour':None,'MinContourValue':None,'MaxContourValue':None,'ContourInterval':None,'ContourLevels':'','LabelDecimalPlaces':None,'LabelTrimZeros':False,'LabelUnits':'','OutputLayer':'TEMPORARY_OUTPUT'})

Sample Data
survey_points.zip

Cannot load plugin in 2.1.0

Hi Chris,

As latest development QGIS version updates, I started getting following messages on start up, and "contour" gets reported as broken plugin.

Couldn't load plugin contour due an error when calling its classFactory() method

Traceback (most recent call last):
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 204, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:/Users/misha/.qgis2/python/plugins\contour__init__.py", line 47, in classFactory
from contour import Contour
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:/Users/misha/.qgis2/python/plugins\contour\contour.py", line 41, in
from shapely.geometry import MultiLineString, MultiPolygon
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 453, in import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\shapely\geometry__init
.py", line 4, in
from geo import box, shape, asShape, mapping
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\shapely\geometry\geo.py", line 5, in
from point import Point, asPoint
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\shapely\geometry\point.py", line 7, in
from shapely.geos import lgeos, DimensionError
File "C:/OSGeo4W/apps/qgis-dev/./python\qgis\utils.py", line 453, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python27\lib\site-packages\shapely\geos.py", line 99, in
geos_capi_version = geos_c_version = _geos_c_version()
File "C:\OSGeo4W\apps\Python27\lib\site-packages\shapely\geos.py", line 97, in _geos_c_version
return tuple(int(n) for n in v.split('.'))
File "C:\OSGeo4W\apps\Python27\lib\site-packages\shapely\geos.py", line 97, in
return tuple(int(n) for n in v.split('.'))
ValueError: invalid literal for int() with base 10: '2 r3921'

Python version:
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.1.0-Master Master, d901e50

Python path: ['C:/OSGeo4W/apps/qgis-dev/./python', u'C:/Users/misha/.qgis2/python', u'C:/Users/misha/.qgis2/python/plugins', 'C:/OSGeo4W/apps/qgis-dev/./python/plugins', 'C:\OSGeo4W\apps\orfeotoolbox\python', 'C:\OSGeo4W\bin', 'C:\OSGeo4W\bin\python27.zip', 'C:\OSGeo4W\apps\Python27\DLLs', 'C:\OSGeo4W\apps\Python27\lib', 'C:\OSGeo4W\apps\Python27\lib\plat-win', 'C:\OSGeo4W\apps\Python27\lib\lib-tk', 'C:\OSGeo4W\apps\Python27', 'C:\OSGeo4W\apps\Python27\lib\site-packages', 'C:\OSGeo4W\apps\Python27\lib\site-packages\PIL', 'C:\OSGeo4W\apps\Python27\lib\site-packages\win32', 'C:\OSGeo4W\apps\Python27\lib\site-packages\win32\lib', 'C:\OSGeo4W\apps\Python27\lib\site-packages\Pythonwin', 'C:\OSGeo4W\apps\Python27\lib\site-packages\wx-2.8-msw-unicode']

Best Regards,
Mikhail

Issues when handling integer fields

First of all congratulation for this plugin. But unfortunately, it crashes when handling field of type "integer"

Error message below :

---------------------------------------------------------------------------------------

An error has occured while executing Python code:

Traceback (most recent call last):
File "~/.qgis2/python/plugins/contour/contour.py", line 277, in uFieldNameUpdate
self.uMinContour.setValue(np.min(z))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/fromnumeric.py", line 1895, in amin
return amin(axis, out)
ValueError: zero-size array to minimum.reduce without identity

Python version:
2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)]

QGIS version:
2.0.1-Dufour Dufour, f738351

Python path: ['/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins/processing', '/Applications/QGIS.app/Contents/MacOS/../Resources/python', '/.qgis2/python', '/.qgis2/python/plugins', '/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins', '/Library/Frameworks/SQLite3.framework/Versions/B/Python/2.7', '/Library/Frameworks/GDAL.framework/Versions/1.10/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/phreeqpy-0.2.0-py2.7.egg', '/Library/Python/2.7/site-packages/Shapely-1.2.18-py2.7.egg', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/usr/local/lib/wxPython-2.9.4.0/lib/python2.7', '/Applications/QGIS.app/Contents/Resources/python/plugins/fTools/tools', '~/recherche/Seine/SIG']

input raster

can I use this plugin starting from a DTM raster to create polygons of a certain elevation range?

Broken Plugin when loading to V2.2.0

Hi,

When I try to load the Contour Plugin I get the following message:

The Plugin is broken. Python said: ascii

I don't have many other plugins installed, and I used to use this plugin on older versions of QGIS. Any ideas where the interference is coming from?

Error when computing contours with Quantile method (looking for missing z value)

An error has occured while executing Python code:

Traceback (most recent call last):
File "****_plugins\contour\contour.py", line 288, in changeMethod
self.computeLevels()
File "
_****plugins\contour\contour.py", line 315, in computeLevels
values = np.sort(self.z.flatten())
AttributeError: 'ContourDialog' object has no attribute 'z'

Python version:
2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit (AMD64)]

QGIS version:
2.0.1-Dufour Dufour, d94c044

Use contourpy directly

matplotlib uses an underlying python contouring library contourpy.

This is a much more suitable tool for implementing contouring in QGIS and provides a simpler contouring interface.

It is installed if matplotlib is installed, so will be available in any case if matplotlib is (ie not additional installation). But using it directly means that it can be used without the extra code of matplotlib.

"Extend filled contour options [optional]" isn't optional

Throws errors unless somethings specified, even if not filling contours.

Traceback (most recent call last):
File "~/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 116, in _getEnumValue
id=values[int(id)]
ValueError: invalid literal for int() with base 10: ''

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "~/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 290, in processAlgorithm
extend = self._getEnumValue( parameters, self.PrmExtendContour, context )
File "C:\Users/jmcguiness/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\contour\ContourGeneratorAlgorithm.py", line 118, in _getEnumValue
raise ContourGeneratorAlgorithmError(
contour.ContourGeneratorAlgorithm.ContourGeneratorAlgorithmError: Invalid value for ExtendOption

KeyError: 15630

Hi Chris. I'm using the plugin with QGIS 2.0.1 to process some lidar data and have this error message that pops up with the following information:

An error has occured while executing Python code:

Traceback (most recent call last):
File "C:\Users\Steven/.qgis2/python/plugins\contour\contour.py", line 367, in accept
self.makeContours()
File "C:\Users\Steven/.qgis2/python/plugins\contour\contour.py", line 577, in makeContours
lines = self.computeContours()
File "C:\Users\Steven/.qgis2/python/plugins\contour\contour.py", line 621, in computeContours
cs = plt.tricontour(x, y, z, levels, extend=extend)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\pyplot.py", line 3090, in tricontour
ret = ax.tricontour(_args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\axes.py", line 8922, in tricontour
return mtri.tricontour(self, _args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 280, in tricontour
return TriContourSet(ax, _args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 36, in init
ContourSet.init(self, ax, _args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\contour.py", line 780, in init
self._process_args(_args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 47, in _process_args
tri, z = self._contour_args(args, kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\tricontour.py", line 82, in _contour_args
Triangulation.get_from_args_and_kwargs(_args, *_kwargs)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\triangulation.py", line 172, in get_from_args_and_kwargs
triangulation = Triangulation(x, y, triangles, mask)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\tri\triangulation.py", line 72, in init
dt = delaunay.Triangulation(self.x, self.y)
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\delaunay\triangulate.py", line 123, in init
self.hull = self._compute_convex_hull()
File "C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\matplotlib\delaunay\triangulate.py", line 158, in _compute_convex_hull
hull.append(edges.pop(hull[-1]))
KeyError: 15630

Python version:
2.7.4 (default, Apr 6 2013, 19:54:46) [MSC v.1500 32 bit (Intel)]

QGIS version:
2.0.1-Dufour Dufour, 34139bc

Python path: ['C:/PROGRA1/QGISDU1/apps/qgis/./python/plugins\processing', 'C:/PROGRA1/QGISDU1/apps/qgis/./python', 'C:\Users\Steven/.qgis2/python', 'C:\Users\Steven/.qgis2/python/plugins', 'C:/PROGRA1/QGISDU1/apps/qgis/./python/plugins', 'C:\PROGRA1\QGISDU1\bin\python27.zip', 'C:\PROGRA1\QGISDU1\apps\Python27\DLLs', 'C:\PROGRA1\QGISDU1\apps\Python27\lib', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\plat-win', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\lib-tk', 'C:\PROGRA1\QGISDU1\bin', 'C:\PROGRA1\QGISDU1\apps\Python27', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\PIL', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\win32', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\win32\lib', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\Pythonwin', 'C:\PROGRA1\QGISDU1\apps\Python27\lib\site-packages\wx-2.8-msw-unicode', 'C:\PROGRA1\QGISDU1\apps\qgis\python\plugins\fTools\tools', 'F:/Work/12Reuters_25SpringvaleRd_development/data_HO']

Calling contour from other modules

A user is asking how to call the contour plugin from other plugins. The current design is not well suited for this as it does not separate user interface from processing functionality.

It is proposed that it be refactored to do this. It may be possible to incorporate this into the QGIS processing framework at the same time.

Plugin crashes in verison 2.18

As you may have noticed, there are bug reports on other platforms for your wonderful library and the latest version of QGIS.

I tossed in some logging code into my Python console. After I ran the plugin on a few dozen points, with all of the default options selected, QGIS immediately crashed and this was in the log.

$ cat /tmp/qgis.log 
Python warning(1): warning:/home/palewire/.qgis2/python/plugins/contour/contour.py:767: DeprecationWarning: QgsExpression.prepare() is deprecated
  if not expression.prepare(fields):

traceback:  File "/home/palewire/.qgis2/python/plugins/contour/contour.py", line 114, in run
    dlg.exec_()
  File "/home/palewire/.qgis2/python/plugins/contour/contour.py", line 350, in uDataFieldUpdate
    self.reloadData()
  File "/home/palewire/.qgis2/python/plugins/contour/contour.py", line 361, in reloadData
    data=self.getData()
Python warning(1): warning:/home/palewire/.qgis2/python/plugins/contour/contour.py:775: DeprecationWarning: QgsExpression.evaluate() is deprecated
  zval=expression.evaluate(feat)

traceback:  File "/home/palewire/.qgis2/python/plugins/contour/contour.py", line 114, in run
    dlg.exec_()
  File "/home/palewire/.qgis2/python/plugins/contour/contour.py", line 350, in uDataFieldUpdate
    self.reloadData()
  File "/home/palewire/.qgis2/python/plugins/contour/contour.py", line 361, in reloadData
    data=self.getData()

Error on processing algorithm using the same parameters' name

Error when I tried to generate a second contour using the exact same name of parameters including 'InputField' and 'InputLayer'.

Using this code:

import processing
layer=iface.mapCanvas().currentLayer()
result=processing.run(
   "contourplugin:generatecontours",
      { 'ContourInterval' : 1, 
        'ContourLevels' : '', 
        'ContourMethod' : 1, 
        'ContourType' : 0, 
        'DuplicatePointTolerance' : 0, 
        'ExtendOption' : 0, 
        'InputField' : '"z"', 
        'InputLayer' : layer,
        'LabelDecimalPlaces' : -1, 
        'LabelTrimZeros' : False, 
        'LabelUnits' : '', 
        'MaxContourValue' : None, 
        'MinContourValue' : None, 
        'NContour' : 20, 
        'OutputLayer' : 'memory:' }
        )
layer=result['OutputLayer']
QgsProject.instance().addMapLayer(layer)

This is what I got:

Traceback (most recent call last):
  File "/usr/lib/python3.6/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "<string>", line 19, in <module>
  File "/usr/share/qgis/python/plugins/processing/tools/general.py", line 84, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "/usr/share/qgis/python/plugins/processing/core/Processing.py", line 194, in runAlgorithm
    raise QgsProcessingException(msg)
_core.QgsProcessingException: There were errors executing the algorithm.

tried on Ubuntu 18.04

Plugin error

Hi,

I get an error message when opening QGIS 3.10: "AttributeError: 'tuple' object has no attribute 'read'."
I run QGIS on a MacBook Pro, version macOS Catalina 10.15.6. I need to get this plugin working asap. Can you please assist ? I don't know much about Python.

Thank you,
Virginie

AttributeError: 'tuple' object has no attribute 'read'
raceback (most recent call last):
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 334, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/contour/init.py", line 38, in classFactory
from .ContourPlugin import ContourPlugin
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 744, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/contour/ContourPlugin.py", line 38, in
from .ContourGeneratorProvider import ContourGeneratorProvider
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 744, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/contour/ContourGeneratorProvider.py", line 31, in
from .ContourGeneratorAlgorithm import ContourGeneratorAlgorithm
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 744, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/contour/ContourGeneratorAlgorithm.py", line 47, in
from .ContourGenerator import ContourGenerator, ContourType, ContourExtendOption
File "/Applications/QGIS3.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 744, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/contour/ContourGenerator.py", line 11, in
qgis_qhull_fails=platform.platform().startswith('Linux')
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 1182, in platform
system, node, release, version, machine, processor = uname()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 857, in uname
processor = _syscmd_uname('-p', '')
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/platform.py", line 613, in _syscmd_uname
output = subprocess.check_output(('uname', option),
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/run/init.py", line 145, in new
process = cls.create_process(command, stdin, cwd=cwd, env=env, shell=shell)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/run/init.py", line 121, in create_process
shlex.split(command),
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 311, in split
return list(lex)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 300, in next
token = self.get_token()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 109, in get_token
raw = self.read_token()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/shlex.py", line 140, in read_token
nextchar = self.instream.read(1)
AttributeError: 'tuple' object has no attribute 'read'

Python version: 3.8.2 (v3.8.2:7b3ab5921f, Feb 24 2020, 17:52:18) [Clang 6.0 (clang-600.0.57)]
QGIS version: 3.10.6-A Coruña A Coruña, exported

Python Path:
/Applications/QGIS3.app/Contents/MacOS/../Resources/python
/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS3.app/Contents/MacOS/../Resources/python/plugins
/Library/Frameworks/SQLite3.framework/Versions/F/Python/3.8
/Library/Frameworks/Python.framework/Versions/3.8/lib/python38.zip
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/lib-dynload
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
/Users/virginiebrunetaud/Library/Application Support/QGIS/QGIS3/profiles/default/python

Outstanding issues from processing redevelopment

  • Build automated test suite
  • Add options for storing as 3d features with Z, ZM
  • Add rendering options to processing - maybe as second processing algorithm
  • Add support for adding layer properties to processing generated layers in the same way as the dialog (note that properly this needs getting the source layer name where defined)
  • Duplicate point value - should not recalculate for every incremental change of value in dialog.
  • Enum parameters currently passed as integers. Would be much better for the future if passed as string codes such as 'quantile','fixed', etc

Contour error

Hi,
I've been trying to use this plugin, however I find this error:

The contour plugin is disabled as it requires python modules numpy, matplotlib, and shapely which are not all installed.

I'm using:

  • Qgis: 2.18 "Las palmas"
  • Python: Python 2.7.13
  • Matplotlib: 1.5.2rc2
  • Numpy: 1.11.0
  • Shapely: 1.5.17
  • Fedora 24

Someone knows how to fix it ?

Thanks!!!!

-Alejo

plugin makes QGIS crash

Hello,
I'm using the contour plugin on QGIS 2.10, ubuntu. It's making QGIS crash very often. I don't know if you need a test case as virtually everything I'm trying to do with it fails. Did you notice the same issue ? It may be a problem with my config. Do you have ways to print debug information when the plugin crashes ?
Thanks

Missing python modules?

I just installed QGIS 3.2 with GDAL complete on a Mac (running the latest OS X 10.13.6) from the official QGIS page (it is a Kyngchaos distribution). I followed the instructions for setting the environment PATH variable, and I have confirmed that the latest versions of numpy and matplotlib are in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages. However, I still get the error "The contour plugin is disabled as it requires python modules numpy and matplotlib which are not both installed".

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.