Feature request #15905

QgsGeometryAnalyzer, buffer: Allow specification of segments

Added by Håvard Tveite 12 months ago. Updated 6 months ago.

Pull Request or Patch supplied:Yes Resolution:
Easy fix?:No


For the QgsGeometryAnalyzer buffer function, it would be useful to be able to specify the number of segments (for approximating arcs).
Number of segments is the second parameter to the QgsGeometry buffer function (that is used by QgsGeometryAnalyzer bufferFeature that is in turn used by QgsGeometryAnalyzer buffer). Current behaviour is to always use 5 for the segment parameter of QgsGeometry buffer.

It seems as if not many changes would need to be made in the code.

QgsGeometryAnalyzer::bufferFeature would need a new parameter ("segments"), and in the line

bufferGeometry = featureGeometry.buffer( currentBufferDistance, 5 );

"5" would have to be changed to "segments".

QgsGeometryAnalyzer::buffer would also need a new parameter ("segments"), and in the two lines

bufferFeature( currentFeature, processedFeatures, &vWriter, dissolve, dissolveGeometry, bufferDistance, bufferDistanceField );

the "segments" parameter would need to be added.

If the new "segments" parameter is optional and added as the last one, existing applications should not be affected.

If there is interest, I can try to create a pull request on github, but I guess there may be more to do then just what I have suggested above...


#2 Updated by Giovanni Manghi 7 months ago

  • Easy fix? set to No

#3 Updated by Håvard Tveite 7 months ago

If my pull request does not fix this, it would be nice if someone could explain what the problem is.

#4 Updated by Giovanni Manghi 7 months ago

  • Description updated (diff)
  • Pull Request or Patch supplied changed from No to Yes

Try raise the problem directly in the PR or in the dev mailing list, thanks!

#5 Updated by Håvard Tveite 7 months ago

Thanks. I have tried the dev list.

#6 Updated by Alexander Bruy 6 months ago

This is not necessary/useful with upcomming Processing refactoring.

Also available in: Atom PDF