7

Is there any method generating a wedge buffer, as in Creating wedge buffers from many to one in QGIS, using QGIS Python API?

I made a search in QGIS API Documentation and GIS SE.

I'm not looking for a script, only a useful function to generate a wedge buffer for a point.

2
  • The trigonometry for making a "buffer" that shape from a given point, distances, and angles isn't that hard, so you could code it in Python from scratch.
    – Spacedman
    Sep 25 at 12:01
  • @Spacedman I needed a quick solution now. I will probably need my own wedge buffer function that has different properties. Thank you. Sep 25 at 15:18
8

Yes. Import these:

>>> from qgis.core import QgsGeometry, QgsPoint

Then:

>>> QgsGeometry.createWedgeBuffer(QgsPoint(1,2), 25, 5, 2, )
<QgsGeometry: CurvePolygon (CompoundCurve (CircularString (1.76536686473017967 3.84775906502257348, 1.84523652348139877 3.8126155740733001, 1.92349722647006782 3.77402166635644321),(1.92349722647006782 3.77402166635644321, 1 2),(1 2, 1.76536686473017967 3.84775906502257348)))>

Documented:

https://qgis.org/api/classQgsGeometry.html#ac99eef4d4d213c72559f4bd3fe5aefa6

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.