Giter Site home page Giter Site logo

polygon-divider's Introduction

icon Polygon Divider QGIS Plugin

Polygon Divider is a plugin for QGIS that takes a polygon and efficiently divides it into a number of 'squareish' polygons of a defined size, which is useful for a multitude of applications such as land parceling, environmental sampling, and so on.

As a simple worked example, you can take a polygon like this:

hull

...and divide it into a number of smaller 'squareish' polygons of about 1000m2 (it would be exactly 1000m2 if the polygon happened to have an area that precisely divides by 1000):

divided hull

There are two options available to the user when dividing a polygon. The above uses the absorb method, whereby all of the polygons are slightly larger than the requested size, in order to 'absorb' any odd-sized 'offcuts' that would otherwise be left behind. The other alternative would be the offcut method. An example of this is given below, in which all of the polygons would be the precise size as requested, except for the light green one at teh very top, which represente the 'offcut':

offcut hull

The choice of which is best from the above will vary depending upon the specific requirements of the user, and the simplicity of the polygon in question.

Each of the above cutting methods can be undertaken in 4 directions: left-right, right-left, bottom-top and top-bottom. Again, depending upon the shape of the specific polygon to be divided, better results might be achieved in some directions than others.

Each output polygon inherits all of the attributes from its parent, as well as the following additional attributes:

  • ps_id: a unique integer ID for each output polygon
  • ps_uuid: a version 4 uuid
  • ps_area: the area of the polygon
  • ps_repPointX: the X coordinate of a point guaranteed to be within the resulting polygon (not necessarily the geometric centroid, as this is not gurranteed to be within the resulting polygon)
  • ps_repPointY: the Y coordinate of a point guaranteed to be within the resulting polygon (not necessarily the geometric centroid, as this is not gurranteed to be within the resulting polygon)

The software should work well on some quite complex polygons:

complex division example 1

...even if they are very large:

complex division example 1

In cases where the algorithm finds the geometry difficult to divide, it will make the polygons slightly less square and more rectangular (as is illustrated in both of the above examples). If you find that it doesn't manage to divide a certain geometry at all, then you can normally remedy this by simplifying it a little.

Please do get in touch with a copy of any polygons that do not work, they will help us continue to improve this plugin!

A standalone version of this plugin (i.e. not dependent upon QGIS) will be available shortly.

Acknowledgements:

The production of this plugin was funded by Zero Waste Scotland Ltd.. Development was greatly assisted by the accepted answer to this forum post and by the pyroots Python implementations of Brent's method.

polygon-divider's People

Contributors

kapildevadk avatar

Stargazers

 avatar

Watchers

 avatar

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.