2

I want to divide a square into 25 smaller squares. The square layer has a UTM coordinate system, so when plotted, it doesn't have flat bottoms and tops. When I try st_make_grid() function to overlay a grid on top of it, it uses bounding box to do that, and I get a grid that doesn't perfectly overlap with the initial square. Kindly see the figure below where the red square is the initial, target square and the grid is the one created by the st_make_grid() function. I want to know if there is a way to divide the squares into equal-sized, smaller squares without getting this misalignment problem. enter image description here

I'm providing a set of coordinates in "BGS2005_UTM_zone_35N" coordinate system, which you can use to reproduce the original data. Five sets of coordinates are provided for direct use of the st_polygon() function.

data.frame(x = c(924081.5, 920804.9, 970816.1, 974096.0, 924081.5), y = c(4260553, 4310549, 4313844, 4263815, 4260553))

1 Answer 1

0

I don't have R, but I was able to do this with other software. I divided all 4 sides and created points in Excel like this:

=-1*(A5-A2)/5+A5

=-2*(A5-A2)/5+A5

=-3*(A5-A2)/5+A5

=-4*(A5-A2)/5+A5

In QGIS I created Lines using Snap-to-Points and then created Polygons by turning on Snap-to-Intersections. enter image description here

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.