Does anybody know if there is a way to statistical calculate the similarity of two polygons using QGIS?
I want to know how similar is the polygon (red outline) with the polygon (black outline).
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
There is a script available at https://github.com/anitagraser/QGIS-Processing-tools/blob/master/1.1/scripts/hausdorff_distance_pairwise.py
It needs to be updated by changing the following line:
from processing.core.VectorWriter import VectorWriter
from processing.tools.vector import VectorWriter
Save the script in
Now when you open QGIS and the Processing Toolbox you can search for 'hausdorff'
Add your two layers to compare
Open the script and set the options - you need some key fields so the correct features can be compared to each other.
Once the tool has run the output file has a new field - HAUSDORFF - added to it with the similarity score. Smaller is better.
I found the script worked with polylines rather than polygons and you can use the Vector > Geometry Tools > Polygons to Lines tool to convert.
You don't describe your objective clearly, so I assume that you want to use the resulting statistics to compare how well various simplified polygons fit their complex counterparts.
If so, you can create your own metric for that: