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?

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.

  • thanks nhopton. In the end I had to use the intersect tool rather than clip to get the result I needed. But thanks for pointing me in the right direction – Andy Harvey Aug 7 '12 at 18:35
  • That's very odd, did "clip" not work? It should have done. N. – nhopton Aug 7 '12 at 19:19
  • Yes, Vector\Geoprocessing Tools\Intersect worked for me. – jhza Oct 23 '13 at 14:08
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/

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.