3

In QGIS I have created an irregularly shaped polygon.

I can create a grid based on the maximum extents of the polygon via Vector>Research Tools>Vector Grid.

However, I need the grid to only be displayed inside the polygon's boundaries.

How can I create a grid within a polygon in QGIS?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Andy Harvey
  • 507
  • 3
  • 6
  • 13

2 Answers2

6

Create the grid layer and then clip it with the polygon? Vector -> Geoprocessing Tools -> Clip. It would probably be best to create your grid with lines, rather than polygons. N.

nhopton
  • 6,983
  • 1
  • 19
  • 36
0

For some reason I couldn't get the clip function to work as suggested by nhopton.

I managed to achieve that same goal with the following:

Go to Vector>Data Management Tools>Join Attributes By Location. In the dialogue the target vector layer is the hex bin grid and the join vector layer is your original shapefile. For attribute summary keep Take attributes of first located feature selected. We aren’t after the data from this join just selecting the study area. Make sure that Only keep matching records is selected so that it will drop all of the hexes outside of your study area.

source: http://ryanruthart.com/using-qgis-to-create-a-hex-bin-map-and-aggregate-data/

NWT Adam
  • 1,014
  • 1
  • 10
  • 28