Feature request #15905

QgsGeometryAnalyzer, buffer: Allow specification of segments

Added by Håvard Tveite 7 months ago. Updated about 1 month ago.

Status:Open
Priority:Normal
Assignee:-
Category:Geometry
Pull Request or Patch supplied:Yes Resolution:
Easy fix?:No

Description

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...

History

#2 Updated by Giovanni Manghi about 2 months ago

  • Easy fix? set to No

#3 Updated by Håvard Tveite about 2 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 about 2 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 about 1 month ago

Thanks. I have tried the dev list.

#6 Updated by Alexander Bruy about 1 month ago

This is not necessary/useful with upcomming Processing refactoring.

Also available in: Atom PDF