6

enter image description hereI'm using ArcGIS Desktop 10.2.

I have many polygons (buildings) with various areas and I want the same area for all my polygons: 100m². The final goal is to aggregate them and build the urban agglomeration.

I was thinking of creating a buffer with a value for each polygon and using the field value to generate the buffer, but the challenge is to find the value.

6
  • 2
    Please add screenshot of polygons
    – Bera
    Commented Oct 28, 2016 at 9:18
  • 3
    While theoretically possible, it could take CPU-days to iterate through all the possible radius values. It would be much simpler to just constuct a rectangle, square, circle, or other regular polygon at the centroid.of the original shape. Please edit the question to provide more information about your requirements and what you have attempted. A couple of dozen lines of Python code would not be inappropriate.
    – Vince
    Commented Oct 28, 2016 at 10:25
  • 2
    If you show an image, it will be easier to understand full picture.
    – Shiko
    Commented Oct 28, 2016 at 11:08
  • My polygons are buildings. The final goal is to aggregate them and build the urban agglomeration. I didn't think of create a rectangle... it's a good way, but I would like to keep the orientation of my buildings.
    – piero
    Commented Oct 28, 2016 at 12:40
  • Can you clarify this sentence "The final goal is to aggregate them and build the urban agglomeration."? What is the purpose of having these buildings increased in size to exactly 100m2?
    – DMusketeer
    Commented Oct 28, 2016 at 14:38

2 Answers 2

3

Similar to this question, your task doesn't have analytical solution. Fortunately an accurate estimate can be found numerically through iterations and by using root-finding techniques.

Create a copy of your buildings, call it "polygons" in active mxd table of content and run this script:

import arcpy
target,tolerance=500,0.001
maxR=pow(target/3.141593,0.5)

mxd = arcpy.mapping.MapDocument("CURRENT")
buffers = arcpy.mapping.ListLayers(mxd,"POLYGONS")[0]
with arcpy.da.UpdateCursor(buffers,"SHAPE@") as cursor:
    for i,row in enumerate(cursor):
        shp=row[0]; area=shp.area
        arcpy.AddMessage('Processing polygon No %i'%i)
        if area>=target:continue
        low,high=0,maxR
        while True:
            middle=0.5*(low+high)
            newPgon=shp.buffer(middle)
            if (high-low)<tolerance: break
            curArea=newPgon.area
            if curArea<target:low=middle
            else:high=middle
        cursor.updateRow((newPgon,))

OUTPUT:

enter image description here

Note: you need to modify target value, e.g. change it to 100. Script tested on shapefile, you have to start editing session, if "polygons" stored in database, so that ArcGIS will be able to recalculate Shape_Area field. The accuracy of solution only depends on ArcGIS ability to compute buffer.

It took under 2 seconds to complete task for 95 polygons shown on my very old PC.

0
2

You may use below algorithm :

Steps:
1) loop through all polygons, get the area of polygon x .
2) check if it is below or above 100m2.
3) use the python code in below link to increase scale of your polygon with very small portion like :

scale_geom(some_geom, 0.01)  

Is there ArcPy tool for polygon resizing like Scale tool of Advanced Editing toolbar in ArcMap?

4) Check the area of returned scaled geometry from previous function, then you will have value for how many m2 per 0.01 %.

5) once you know how many m2 per 0.01%, you can do the math to get how many m2 and percentage needed to scale the polygon to reach area of 100m2 .

6) call the scale_geom function with scale percentage (either by +ve or -ve ) needed and voila the returned geometry.

NB:

  • To get nearest number from 100m2, you may need to increase decimal and percentage. Instead of get m2 per 0.01, use smaller value like m2 per 0.0001 in oreder to reach number near from 100m2 per polygon.

  • percentage should be in negative if want to decrease the area of original polygon and should be in positive if want to increase the original polygon area .

  • I was about to add the buffer zone as second solution but it doesn't reflect the same shape of buildings and also above function (scale_geom) reserve the rings inside the shapes.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.