Grass, Smoothing Shapefiles, Polygonizing Raster Data

I’ve been working on doing some new Google Maps for my blog with QGIS. Here are some areas I’ve been exploring that I thought might be useful to the mappers of the world.

Simplification and Smoothing of Shapefiles

Sometimes we need a simplified version of a vector, to have a smaller file size and get rid of unnecessary details. Many tools do this in a very rough way, and miss the adjacency and sometimes the topological correctness of polygons. GRASS is the ideal tool for this: being a topological GIS, adjacency and correctness are preserved even at very high simplification levels. In our case, we have a vector resulting from a raster, thus showing a β€œsaw” pattern at borders.

Applying a simplification results in straight lines:

GRASS β€£ v.generalize [Maximal tolerance value: 30 m]

We can also do the reverse, and make a layer more complex, smoothing out sharp corners:

GRASS β€£ v.generalize [method: chaiken]

This v.generalize tutorial also has many helpful tips on the various options of the library to get better smoothing results and reduce file sizes. It’s fantastic how much of the power of GRASS has been integrated into Quantum GIS.

Converting Raster Data Into Stepped Vectors

In QGIS 3.4.1, there is a Reclassify by table tool which is located under Processing toolbox -> Raster analysis -> Reclassify by table.

After reclassify the data, you can use Vectorize tool to convert the raster into vector data. The Vectorize tool exists in both QGIS 2.18 and 3.4.

This is very helpful for converting a raster image within a certain area into a polygon for creating a Google Map or other map.

Leave a Reply

Your email address will not be published. Required fields are marked *