1

I have 32 points than I need to create a 2 mile square polygon around, and break each polygon into 4 quadrants. I've tried a few things, including creating an MBR(Minimum Bounding Rectangle) around a standard buffer, but those don't output perfect squares for some reason, which doesn't necessarily totally matter, but I hit a wall when I try to break the square polygons into quadrants.

I'm using the NAD 1983 UTM Zone 12N coordinate system for the map. The Geodatabase for my data is GCS_North_American_1983. I'm using ArcGIS 10.3.1

Here's an example of what I generally need. example

  • 1
    What is an MBR? – Mox Oct 27 '15 at 17:58
  • 1
    Please edit your question to specify the version of ArcGIS, the coordinate system of the data, and the coordinate system of the map canvas. If your preferred programming interface is not Python, you should specify that as well. – Vince Oct 27 '15 at 17:59
  • minimum bounding rectangle, sorry! added to the question – AlexGilvarry Oct 27 '15 at 17:59
  • 2
    You can use Fishnet for this type of operation. Although, you'll need to extract the coords from the plot center and manipulate this (i.e. subtract x/y coords) to form the fishnet origin. All of this can be accomplished with Python and arcpy. – Aaron Oct 27 '15 at 18:23
  • 1
    You can do it using my script gis.stackexchange.com/questions/159631/… Let me know if you are able to tweak it, if noy I'll do it – FelixIP Oct 27 '15 at 19:07
1

Depending on the way the map on your screen is projected, the resulting shape may not look perfectly square. See here.

Difficult work-around would be to split your polygon into lines, get the midpoints of the lines, draw lines between them, merge the result into a polygon, and then use that to clip the original square. But there must be a better way.

0

Use your buffers as first parameter for script:

enter image description here

enter image description here

Use empty folder as second parameter for script. Run script. Merge all shapefiles in input folder to get this:

enter image description here

Script:

import arcpy, traceback, os, sys
from arcpy import env
env.overwriteOutput = True
inFC=arcpy.GetParameterAsText(0)
outFolder=arcpy.GetParameterAsText(1)

tempf=r'in_memory\many'

def showPyMessage():
    arcpy.AddMessage(str(time.ctime()) + " - " + message)

try:
    m,n=0,0
    with arcpy.da.SearchCursor(inFC, "SHAPE@") as rows:
        for row in rows:
            shp = row[0]
            extent=shp.extent
            origPoint='%s %s' %(extent.XMin,extent.YMin)
            yPoint='%s %s' %(extent.XMin,extent.YMax)
            endPoint='%s %s' %(extent.XMax,extent.YMax)

            nRows,nCols=2,2

            arcpy.CreateFishnet_management(tempf, origPoint,yPoint,
                                           "0", "0", nRows, nCols,endPoint,
                                           "NO_LABELS", "", "POLYGON")
            arcpy.AddField_management(tempf, "Label", "Text", 25)
            m+=1
            arcpy.AddMessage(m)
            with arcpy.da.UpdateCursor(tempf, ("SHAPE@","Label")) as rows:
                for row in rows:
                    m+=1
                    row[1]=str(m).zfill(8)
                    rows.updateRow(row)
            n+=1
            arcpy.CopyFeatures_management(tempf, '%s%sfnet_%s'%(outFolder,os.sep,str(n).zfill(4)))
except:
    message = "\n*** PYTHON ERRORS *** "; showPyMessage()
    message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]; showPyMessage()
    message = "Python Error Info: " +  str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()

Please note dimensions could be slightly out, because buffer is not exactly circle, just a collection of connected points

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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