ccrook / QGIS-Contour-Plugin

Contour plugin for QGIS - uses python matplotlib to generate contours of data on vector point data.
43 stars 13 forks source link

maximum count of contours #33

Closed jagodki closed 4 years ago

jagodki commented 6 years ago

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

ccrook commented 6 years ago

@jagodki This is set by the NContour parameter of the processing algorithm - so user configurable. It is there to avoid accidentally selecting a very small contour interval that generates an absurd number of countours. If this doesn't work for you can you send me more details of how you are running the algorithm. Thanks.

jagodki commented 6 years ago

@ccrook Thank you for your response. My call of the contour-processing is the following:

processing.run('contourplugin:generatecontours',
                          {'ContourInterval' : equidistance,
                            'DuplicatePointTolerance': 0.0,
                            'ContourLevels' : '',
                            'ContourMethod' : 3,
                            'ContourType' : 1,
                            'ExtendOption' : 0,
                            'InputField' : field.name(),
                            'InputLayer' : input_layer,
                            'LabelTrimZeros' : False,
                            'LabelDecimalPlaces' : 0,
                            'LabelUnits' : 'm',
                            'MaxContourValue' : None,
                            'MinContourValue' : None,
                            'NContour' : None,
                            'OutputLayer' : QDir.toNativeSeparators(output_directory + '/' + prefix_contour + field.name() + suffix_polygon)})

The contour interval can be inserted into a field by the user and will be stored in the variable 'equidistance'. All other parameters related to the count of contours (NContour, MaxContourValue etc.) are set to None. Is it necessary to give the parameter NContour a value unequal None to calculate more than 20 contours for one layer?

ccrook commented 6 years ago

Yes .. the default is 20 - that is what you get if you set it to None. You can set it to some very large number, for example 1000000, to avoid having a practical limit (larger if you want of course).

jagodki commented 6 years ago

Great hint, it works like a charm 👍