I have a big Shapefile with 200,000 polygons but the file is too big for the application that will use it. I would like to generalise these polygons and create much smaller file.
I have tried to do this in QGIS using "Simplify Geometries" tool. I have tried this on a very small portion of my Shapefile and I am happy with the results but have small problem which I do not know how to solve. I have appended the image to show the problem.
WHITE boundaries are boundaries before simplification. RED boundaries are after simplification. The problem areas are circled with orange colour. As you can see "simplified boundaries" contain some areas that after simplification do not belong to any of the previous polygons.
How do I simplify this Shapefile and keep common boundaries between polygons as a single line and eliminate areas that have been created after simplification?
After following suggested instructions
- Convert polygons to lines
- Simplify lines
- Convert lines back to polygons
I get the following results. It is slightly better than before but still I get areas outside original polygons (see white areas in the picture below).
@Andrew suggested that I associate each line with adjacent polygon but I do not know how to do it in QGIS.
I am still trying to complete simplifying polygons process. I have followed instructions suggested in this post and when I thought I got acceptable results one more problem appeared. Below is the summary of what I did with images of results. All steps have been performed using PROCESSING toolbox in QGIS.
- First, I converted polygons to lines
- Second, I cleaned lines using v.clean with break option. This resulted in CLEANED VECTOR LAYER and ERROR LAYER. Error Layer (green dots on the provided image) has green dot on every line intersection. I do not know what this means.
- Third, I simplified lines using "SIMPLIFY GEOMETRY" tool (result in red lines in the images). Comparing simplified red lines and original orange lines I am happy with the result.
- Fourth, I wanted to convert lines back to polygons using "Polygonize" tool in "PROCESSING" and got results that I did not expect (second image with a shaded dark olive colour polygons). It looks like polygonizer connected error layer intersections and created completely different set of polygons ignoring simplified lines.
Could someone explain what went wrong here?
Why red simplified lines were not converted properly to simplified polygons?
As you can see I am not an GIS expert but need to do this myself. I do not know if I am too far from the solution but it is frustrating that I can see simplified lines that I found acceptable for what I'd like to do but cannot convert them to polygons.
Here are two images with results of last two steps of the process: