0

I am loading shapefile with multiple square polygon feature of size 100x100 m in R using st_read. I am able to create a grid of 10x10 m using st_make_grid, but how can I rotate each grid to match the orientation of polygon feature. Any suggestions on how to determine the orientation of every polygon and use that angle to rotate the grid associated with that polygon.

james
  • 15
  • 3
  • Take two adjanced vertex, and calculate the angle between them. Use simple calculation like (y2-y1)/(x2-x1) = tan(alpha). Calculate alpha. For rotation have a look on affine transformations https://r-spatial.github.io/sf/articles/sf3.html#affine-transformations – Grzegorz Sapijaszko May 06 '23 at 20:23

0 Answers0