19

i want to divide a shapefile with many tiles into a lot of smaller tiles. I am searching for a smart solution, because manual edits are out of questions Example

Anyone can help or know a nice function?

1
  • please excuse me for bringing this thread up again. i have a quite similar problem but one aspect is different. i have got some polygons (parcels of land) and i want to split them up in smaller sections. the problem is that this smaller polygon fields should be parallel to the parcel borders. when i use the vector grid tool, the grid is allways facing north. the second point is, that there are serveral polygons in the same shapefile and all of them need such a grid an every grid should be relatable to the corresponding parcel of land. i have got qgis and (if necessary) arcgis 10 - i there any
    – user15373
    Feb 20, 2013 at 14:36

5 Answers 5

17

Using QGIS you can quickly divide a given shapefile up into regular rectangles as you've shown in your example.

  1. Load the original shapefile;
  2. Use Vector|Research Tools|Vector grid and create a grid of polygons the same extent as your shapefile, with the right distance between divisions ('parameters') selected (100 in my example image below);
  3. Intersect the two layers (Vector|Geoprocessing Tools|Intersect), with the first layer as the original shapefile and the second as your vector grid. The output will be your shapefile chopped up by the boundaries of the vector grid.

0
3

I am assuming that the grid you refer to is a spatial grid of some regular size - 1x1 km or similar. These grid objects (squares) will then have some reference number (eg square_id). Your other data set, the zones, is the one you would like to see combined based on the attributes in the spatial grid. This way you end up with the zones being split in smaller (gridded) pieces retaining both the zone_id and the spatial grid reference attributes.

The intersect functionality does this job. It is available both from within ArcGIS and QGIS. The user documentation for ArcGIS explains it excellently, although the functionality is also supported by QGIS.

3

A plugin has been created and can be installed in QGIS. polygon divider

You need to define the area need and the corner you would like begin the split from.

3
  • This plugin is no longer supported :( Important for my workflows, especially with irregularly-shaped sampling areas Nov 2, 2019 at 12:46
  • 2
    I have just pushed a QGIS3 version of this plugin - it should be available in the Plugin Manager shortly.
    – jonnyhuck
    Sep 24, 2020 at 17:12
  • that's great news ! thanks Sep 27, 2020 at 23:26
2

You can create a regular grid using the Vector Grid tool. Just specify the feature(s) you want to use for the extent, and the size of each grid cell you want to use. You may have to make sure the python plugins are enabled and the ftools plugins are installed. Then, you might use the intersect tool as suggested by @ragnvald.

The only problem with this approach is that the tiles will not be numbered in a column/row format. Instead, they will be numbered in the order they are created, usually one row at a time from northeast to southwest. If this doesn't fit your needs, try creating a raster version of the data using the rasterize tool. Rasters essentially store data as a georeferenced matrix with a fixed spacing between rows and columns. This data model might make it easier to set up your routing, but you may have a hard time making sure your original data translates in a meaningful way.

There are a number of established techniques for routing on rasters, such as cost paths and flow direction/accumulation (usually treated in hydrology tools). SAGA GIS has more options for these types of analyses, plus better tools for rasterization, but the interface is a little less straightforward than QGIS.

1

Generating a vector grid is one aspect to this, if I understand you question correctly. If you want to literally split the other features (ie: roads with a grid to have the roads as grid sections) you will want to intersect the road later with the newly created grid layer. This will create sections based on a grid cell. If that collection of roads (which has been divided based on the grid cell) needs to be a single file to itself, then you could perform a split by attribute to a new layer (this function is available in QGIS as a vector plugin, and it will use a attribute value, ie GRIDID, and parse all records in the attribute table with the same GRIDID to its own shapefile. This can be done in batch, making it possible to split up many files like this).

Your Answer

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

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