Giter Club home page Giter Club logo

polygoncomplexity's Introduction

Polygon Complexity

Plugin for QGIS 2.0 that calculates the complexity of polygon features. The complexity measure provides a quantitative description of the polygon shape. It can be used as an input for other geometric algorithms, or to find out if any algorithm depends on the geometric complexity of input polygons in terms of speed or quality of outputs.

The index of complexity used in this plugin is taken from the paper by Brinkhoff, Kriegel, Schneider, and Braun [1]. The advantage of their approach is that it considers local variations of the polygon border. The plugin also calculates a simple compactness measure that relates the area of the polygon to the length of its border.

Fig. 1 Countries categorized by the complexity index.

Fig. 2 Countries categorized by the compactness index

Using the plugin

The following options are available in the plugin's dialog window:

Calculate compactness (CS): calculates the compactness of the polygon is defined as:

polgon_boundary / (3.45 * sqrt(polygon_area))

Calculate complexity (CP): calculates the complexity index as defined [1] as:

0.8 * AP * FQ * (0.2 * CV)

You can also include the following intermediary parameters to the attribute table:

  • Deviation from the covex hull (CV) is a normalized difference between the area of the polygon and the area of its convex hull:

(hull_area - polygon_area) / hull_area

  • Amplitude of the vibration (AP) is a normalized difference between the length of the polygon boundary and the length of the boundary of its convex hull:

(poygon_boundary - hull_boundary) / poygon_boundary

  • Frequency of the vibration (FQ) depicts local variability of the polygons boundary.

16 * (notches_norm - 0.5)4 - 8 * (notches_norm - 0.5)2 - 1

  • Number of vertices (vert)

Fig. 3 Complexity measures for different shapes

Notes

The area and boundary length of the convex hull for multipart polygons is calculated as the sum of convex hulls of polygon parts, to avoid distortions given by remoteness of subparts (archipelagos, USA with Alaska and Hawaii, etc.).

The number of vertices for polygons in the shp data model is actually higher by 1 than what is returned by the plugin, as the closing vertex of the boundary is the same as the first vertex.

References

[1]: Brinkhoff, T., Kriegel, H. P., Schneider, R., & Braun, A. (1995, December). Measuring the Complexity of Polygonal Objects. In ACM-GIS (p. 109). http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.73.1045&rep=rep1&type=pdf

Next steps

There are several other polygon complexity measures that could be implemented to extend this plugin, including:

  • fractal dimension, fractal dimension estimated with the box-counting tecnique (as in Rützel H.: ‘Describing the Complexity of Geometric Objects by Using the Fractal Dimension’ (in German), University of Munich, 1995)
  • shape index by Boyce & Clark 1964
  • vertex-lag method by Bunge (Bunge, W., 1962. Theoretical Geography. First Edition. Lund Studies in Geography Series C: General and Mathematical Geography. Lund, Sweden: Gleerup.)
  • indexes mentioned in Moser et al. 2002 (double log fractal dimension, number of shape characteristic points)
  • shape variation from Ferson et al. 1985
  • method by Lee & Sallee 1970
  • maybe also the Fourier-based method from Ehrlich & Weinberg 1970

polygoncomplexity's People

Contributors

pondrejk avatar

Stargazers

Caifa Zhou avatar Hemed Lungo avatar Jaehyun avatar Pye Douglas avatar wenbo zhang avatar Brandon Witham avatar Philipe Borba avatar Rebecca Kehlbeck avatar Nico Mandery avatar  avatar  avatar Adam Erickson avatar ∫ ∪ ∧∴ ∋ ∈ ⊇ ∧ avatar

Watchers

James Cloos avatar

Forkers

rskelly

polygoncomplexity's Issues

Qgis can't load this plugin

Hello, thank you very much for the plugin provided. Now I have a problem. I hope you can help me. When I download this plugin in Qgis, I will prompt: error loading plugin, the plugin seems to be invalid or have unfulfilled dependences, ...the plugin is broken, paython said : no module named fTools.

ZeroDivisionError

The plugin stops execution
leaving the layer in editing mode and throwing the following message


An error has occurred while executing Python code:

ZeroDivisionError: float division by zero
Traceback (most recent call last):
File "/home/rs/.qgis2/python/plugins/PolygonComplexity/PolygonComplexity.py", line 239, in run
feature_notches_normalized = float(feature_notches) / (feature_vertices - 3)
ZeroDivisionError: float division by zero

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.