3

I have a model that I built using model builder that creates a rectangle grid and then rotates it. For some reason, when I use rotate, it creates something wrong-

enter image description here

and it creates''holes'' between the rectangles- enter image description here

When I use the model to create line grid and rotate it, it works well but is different . enter image description here

How can I solve it?

My end goal is to have rotated grid that will be made of polygons. I tried also to create polygons from the grid lines but it didn't work

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105
ReutKeller
  • 2,139
  • 4
  • 30
  • 84
  • It looks like every single feature is rotated around its center. You could try to combine/union/collect/merge all features to one multipolygon (singlepart to multipart, etc.). – Stefan Aug 22 '19 at 09:20
  • https://gis.stackexchange.com/questions/258912/how-to-create-a-grid-inside-a-polygon-that-is-oriented-with-the-longest-side – csk Aug 22 '19 at 20:19

1 Answers1

4

I am not sure how did you rotate the polygon grid, but it seems you have used Rotate tool from Processing toolbox. If so, you need to specify the Rotation anchor [x,y], which enables you to select the rotation position directly from the map canvas, as you can see below:

Before rotation:

enter image description here

Using Rotate tool:

enter image description here

The Rotation anchor [x,y] was selected at the center of the intersection of the 4 polygons:

Final result:

enter image description here

Alternatively, you can use the edit button to start editing, then select all polygons using the selection tool, and finally use the rotate tool enter image description here to rotate the polygons

enter image description here

But be careful, if you choose the alternative approach make sure to work on a copy of the polygon grid because once you save the edit it is irreversible.

ahmadhanb
  • 40,826
  • 5
  • 51
  • 105
  • But if I work with a model builder, I can't choose an anchor – ReutKeller Aug 22 '19 at 08:42
  • @Reut You did not mention that you are using Model builder in your question. Please update your question, and write the method(s) that you are using. – ahmadhanb Aug 22 '19 at 08:44
  • it says on the first sentence that I have model – ReutKeller Aug 22 '19 at 08:47
  • 1
    @Reut I have a model is different from I am using model builder to rotate polygons. – ahmadhanb Aug 22 '19 at 08:50
  • 1
    Does the rotation tool in the model builder allow you to set an expression-based anchor point? If so, an expression like this should work: centroid(collect($geometry)) – csk Aug 22 '19 at 20:17