7

I am working with a set of coordinates from a csv file that creates a grid (of points) in QGIS. There is an id attribute along with the X and Y coordinates for each point.

I need to work with a polygon grid made out of these points. Using the grid tool doesn't work as there is a slight rotation to the points:

I need to create a grid that has a point in each intersection of lines and would look like the following grid I drew by hand:

I looked everywhere for a way of doing so, I found this tutorial but it didn't work for me.

2
  • Tilting may be due to different CRS. Have you ruled this out?
    – Erik
    Sep 18, 2019 at 13:53
  • Yes I checked that first actually, project and layers are all in the same crs.
    – I.M.
    Sep 18, 2019 at 14:03

2 Answers 2

8

This is a bit of a workaround in QGIS 3.8 and requires that the points are separated by a uniform distance (bit it looks like it from your screenshots).

  • Create a grid with the same spacing and dimensions as your points - somewhere in the vicinity with Processing Toolbox --> Create grid enter image description here

Next, enable the editing mode on the new Grid grid. Make sure that the Advanced Digitizing Toolbar is turned on (View --> Toolbars --> Advanced Digitizing Toolbar.

Make sure snapping is enabled: Project --> Snapping Options...

Select all elements of your grid. Select the move tool and move one edge of the grid to the corner point of your points:

enter image description here

Choose the Rotate Feature button. Zoom a lot into that corner point which now fits with the grid. While holding CTRL click on that corner point. You will see a little plus appear to show that this is the rotation point. You need to zoom a lot, since currently the click is not snapping. Now go to the other edge of the points - and with left click start the rotation of your grid there. Zoom in and make sure that you fit the grid well to the points.

enter image description here

Since the rotation does not benefit from the snapping function, you might have a few mm discrepancy, but it should probably be acceptable.

0
5
  1. Generate Voronoi Polygons around your points using Processing Toolbox - Vector Geometry-Voronoi Polygons.
  2. Use Vector - Geometry Tools - Extract Vertices to get the intersections of the newly created Voronoi Polygons.
  3. Creating Voronoi Polygons around the vertices.
    The resulting polygons will have your original points located at their intersections regardless of the slight rotation of your original points.

The only 'Gotchas' here is that the first set of Voronoi you create will not encompass your outer most points. You could add an extra ring of points around your existing dataset and edit the final results.

Your data will also need to be in a projected coordinate reference system for the Voronoi creations.

Below is a screen shot of the first set of Voronoi polygons that highlights the problem with the outer most points.

enter image description here

And here is a screen shot of the second set of Voronoi polygons with the error compounded. If you are able to create the newer outer ring of points, and attribute them as such you could finish by selecting those points, using that selection to select the outer most polygons, and then delete the selection.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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