Wednesday 15 June 2016

qgis - How to Create a Grid Inside a Polygon that is Oriented with the Longest Side?


I have been using a process called "Create Polygon Graticule" to create a grid within a polygon with assigned row and column attributes. It is a SAGA tool which I have been running in QGIS. It generates a grid based on the extent of the input polygon with the cell running N to S and E to W. It would be better for my analysis if the direction of the grid was parallel to the longest edge of the polygon. For reference I have attached images of the current automated output and an output that I manually altered to align the grid with the polygon. The grids originally covered the entire extent of the polygon but have been clipped to show only the cell parts that are inside.



This is the default tool out put Above image is what the tool out puts by default.


enter image description here This is an image of a grid that was edited manually to fit the necessary parameters.


My question is, is there a way to produce grids that are aligned such as the one in the second image in an automated fashion? I will need to generate grids for a few thousand polygons.




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...