[GIS] Drawing points around circle in QGIS

pointqgis

I've got a square origin-destination matrix with 23 elements, I would like to draw each one of these elements as a point around a circle, to achieve a result like the following:

enter image description here

Can you suggest me a fast method to draw points around a circle?

I'm doing the following but doesn't works:

1) set central point

2) create a buffer with segments=99 and distance=50, uncheck "dissolve the result" option
enter image description here

3) convert shape to line, I get 99 lines
enter image description here

4) calculate the line length/23
enter image description here

5) convert line to points, set "insert additional points" to "No", use the result of line length/23 (1316383,260) in "distance" field
enter image description here

What I get is 396 points where the lines touch each other’s:

enter image description here

Best Answer

Never used matrices so I could be wrong. But I would create a buffer from a central point (which you can add manually) and use the radius of a circle (I'm assuming the radius is the same for all of them otherwise you may have to create more buffer layers). When buffering, set the segments to approximate to 99 to have a smoother perimeter:

Point and buffer

You can then use Convert polygons to lines on the buffer layer.

Polygon to line

And with the output, use Convert lines to points (both tools are from SAGA via the Processing Toolbox). This should give you a point layer which lies on the circumference of the circle.

Line to points

Hope this helps.


EDIT:

When you use Convert polygon to lines, calculate the length of line via the Field Calculator by creating a new column (select Decimal numbers) and inserting this into the expression:

$length / 23

This will give the same length for each "segment".

Now when you run the Convert lines to points function, input the length you received into the Insert Distance field. This will produce a 23 points at the same length:

23 points


Alternative method:

Take your final Step 5 layer (with the 396 points) and open up the Attribute Table and Field Calculator. Create a new integer column (eg. RowNum) and insert this expression:

$rownum

This provides each field with a unique value. Next, select the Advanced Filter (Expression) at the bottom of the Attribute Table:

Select Advanced Filter

And enter this command (replace "RowNum" with your named column):

("RowNum") %17

This expression skips every 17th field (396/23 = 17, we want to keep every 17th field). Select ALL those fields shown and DELETE them. Then select the Show All Features at the bottom of the Attribute Table. You should now (let's all pray!) have 23 points. Remember to also save!