1
votes

I would like to create a variety of simple (no self-intersection), independent polygons all with the same area (I will do it multiple times with different areas), but with different perimeter lengths. I guess ideally I would have a factorial design with 10 areas each with 10-20 polygons of varying edge/area ratios (100-200 total polygons). I suppose that the 10 polygons could be generated for 1 area and then a multiplier could be used to increase/decrease the total size of each one for the 10 different area replicates. In reality the shapes don't have to have straight sides, but I figured that would be easier. The polygon doesn't have to be convex, the angles could be highly variable and the shapes irregular, but they don't have to be. The benefit of highly irregular polygons (as opposed to rectangles with different length sides, for example) is the ability to generate polygons with a larger range of perimeter:area ratios.

I am doing this for comparing landscapes with forest harvests of different sizes and shapes (I will eventually apply a function to calculate wildlife abundance for each polygon). Any working solution would do, but solutions using R, Python, and/or GIS (ArcGIS or QGIS) would be preferred. Thanks for any thoughts or suggestions.

1

1 Answers

4
votes

The GeoPandas Module seems to do just what your looking for. Its for python, makes use of python's excellent libraries for data analysis, supports Gis and fiona maps, as well as extensive polygon creation. Check it out here:

https://github.com/kjordahl/geopandas?source=cc

From the Readme:

GeoPandas is a project to add support for geographic data to pandas objects. It currently implements GeoSeries and GeoDataFrame types which is are subclasses of pandas.Series and pandas.DataFrame respectively. GeoPandas objects can act on shapely geometry objects and perform geometric operations.

An example of polygon creation:

>>> p1 = Polygon([(0, 0), (1, 0), (1, 1)])
>>> p2 = Polygon([(0, 0), (1, 0), (1, 1), (0, 1)])
>>> p3 = Polygon([(2, 0), (3, 0), (3, 1), (2, 1)])
>>> g = GeoSeries([p1, p2, p3])
>>> g
0    POLYGON ((0.0000000000000000 0.000000000000000...
1    POLYGON ((0.0000000000000000 0.000000000000000...
2    POLYGON ((2.0000000000000000 0.000000000000000...
dtype: object

With the end result being: polygons

A more complex example of irregular polygons:

>>> boros = GeoDataFrame.from_file('nybb.shp')
>>> boros.set_index('BoroCode', inplace=True)
>>> boros.sort()
>>> boros
               BoroName    Shape_Area     Shape_Leng  \
BoroCode
1             Manhattan  6.364422e+08  358532.956418
2                 Bronx  1.186804e+09  464517.890553
3              Brooklyn  1.959432e+09  726568.946340
4                Queens  3.049947e+09  861038.479299
5         Staten Island  1.623853e+09  330385.036974

                                                   geometry
BoroCode
1         (POLYGON ((981219.0557861328125000 188655.3157...
2         (POLYGON ((1012821.8057861328125000 229228.264...
3         (POLYGON ((1021176.4790039062500000 151374.796...
4         (POLYGON ((1029606.0765991210937500 156073.814...
5         (POLYGON ((970217.0223999023437500 145643.3322...

complex