I have a point feature class in which each point represents the NE (Upper Left) corner of a 5' x 5' excavation unit across an archaeological site (the units are not contiguous). I would like to generate a polygon feature of the 5' x 5' units (in other words, create the other 3 corners - LL, LR and UR and connect them with a closed line and convert to a polygon - (or directly create a polygon feature class if that's possible). Are there existing tools that I can use to do this, or a script that can be modified? I am not a programmer ;-(...I am using ArcGIS Desktop with an Advanced license.
Thanks so much!
sorry... I think in code... there are options here , you are effectively producing a square buffer, except you are offsetting the focus point from the center to the NE corner ... sooo you will have to make some changes to the code.
all she needs to do is change the following lines, using a projected featureclass or shapefile. Specify the width and height
width = 100.0 # width of the output rectangle in meters height = 100.0 # height of the output rectangle hX = 50.0 # this can be +ve or -ve depending which corner you want to point to be focussed on hY = -50.0 # this is for Y (50, -50) for hX and hY will place the origin point in the upper left
# output change this obviously
fc_out = r'D:\Xander\EPM\Datos pruebas\gdb\datos erase.gdb\rectangles3'
and modify the values here
def createRectangleFromPoint(pnt, width, height, hlf, sr): # hlf is the correction to position the point arrPnts = arcpy.Array() pnt2 = arcpy.Point(pnt.X - width + hX, pnt.Y - height + hY) arrPnts.add(pnt2) pnt2 = arcpy.Point(pnt.X - width + hX, pnt.Y + height + hY) arrPnts.add(pnt2) pnt2 = arcpy.Point(pnt.X + width + hX, pnt.Y + height + hY) arrPnts.add(pnt2) pnt2 = arcpy.Point(pnt.X + width + hX, pnt.Y - height + hY) arrPnts.add(pnt2) pnt2 = arcpy.Point(pnt.X - width + hX, pnt.Y - height + hY) arrPnts.add(pnt2) return arcpy.Polygon(arrPnts, sr)
Thank you for the replies! I'm curious about your "easier" solution - I am using a custom coordinate (simply called Local Cartesian Coordinate System) with the following parameters, and the units are in feet:
Local Cartesian Coordinate System
Linear Unit: Foot (0.3048)
Geographic Coordinate System: GCS_WGS_1984
Angular Unit: Degree (0.0174532925199433)
Prime Meridian: Greenwich (0.0)
Semimajor Axis: 6378137.0
Semiminor Axis: 6356752.314245179
Inverse Flattening: 298.257223563
still looks geographic and the 'difficult' one, will get the spatial reference if it is defined and is indeed projected with units of feet, you only need to specify your buffer size in feet. You only run into difficulties when the coordinates are in decimal degrees and you want outputs in feet or meters.
the "easier" solution, in my opinion. that
you can calculate this using field calculator
5/12 is variable you can change a value as you want with 2d of polygon.
3. use " XY TO Line" tool and make start point the upper left coordinate , and end point lower right coordinate.
4. now you can get your polygons using "Feature Envelope To Polygon" and put the pervious line feature as input and check Create multipart features box . The output will be your polygon.