3

I have 100 rasters, each raster has the same cell size and extent and i want to make a polygon of each cell.

Can anyone help me doing this?

2
  • 1
    Is Raster to Polygon what you're looking for? Or do you want a bunch of cell-shaped polygons?
    – Erica
    Commented Mar 13, 2013 at 16:13
  • 3
    If the rasters are the same, and you know their extent, you can use the Create Fishnet tool in ArcMap. there you can set the origin coordinate, and number of lines rows and/or cell size, to create a mesh of polygons.
    – HDunn
    Commented Mar 13, 2013 at 16:55

3 Answers 3

5

If you are looking for cell shaped polygons, as in a grid layer out, you can use the Vector Grid tool in QGIS (Vector - Research Tools). In the tool, you can use the raster files as the grid extents, and set the Parameters to the cell size. This will make a grid polygon layer with each grid to the size of the raster cell (and spatially overlaying the raster).

3

I have found that although my raster files and grid vector (created in QGIS, under Vector > Geoprocessing Tools > Vector Grid) have the exact same extents and cell sizes, I still get slivers when I spatially overlay the raster and grid vector.

In order to avoid this, I used 'Add Grid Values to Shapes' in the Processing Toolbox, as shown below:

enter image description here

This allowed me to add the raster value to the grid itself, as a polygon with the same extent and cell size as my original raster. This can also be completed as a batch process by right clicking the function in the Processing Toolbox, which is helpful if you have multiple raster sets and eventually want them in the same polygon (which can be easily achieved by joining). This method also preserves decimal values from the raster, which converting from raster to polygon does not do (as using the 'Polygonize' tool in QGIS will create an integer value).

Another, longer, way it can be completed (if slivers are an issue) is to create regular points in QGIS (Vector > Research Tools > Regular Points) to make centroids for each raster cell.

enter image description here

These centroid points can be spatially joined with the polygon (converted from a raster) and the resulting points joined with the grid (by FID). When exported (Data > Export Data) into its own shapefile, this will result in the grids having the same value as the points derived from the rasters.

enter image description here

The last steps were completed in ArcMap but can also be done in QGIS, depending on what you are most familiar with.

0

If it is an exact "grid" of polygons over the rasters you are looking for then it is simply (i say simply because i asked the same question a short time ago.

the basic answer is In QGIS go to Raster -> Misc. -> Tile index. Give the path to the raster-files, set the name and directory for the resulting shape.

to give credit to the original answer: Creating vector grid using QGIS?

1
  • This is a really useful tip, but not what the OP (and I) are looking for. Tile Index creates a polygon of the same extent as each raster file, not the extent of each individual cell within the raster.
    – EcologyTom
    Commented Oct 3, 2018 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.