POST
|
Hi Dan, Thank you for your previous help and the tips you have provided but I need further help. Below is what I have: A function that returns the maximum length of each of the rectangular polygons as a list. To be used as a reference edge/segment. A function that returns the minimum length of each of the rectangular polygons as a list. To be used to construct length of a perpendicular edge. A function that gets the coordinates of the endpoints of a polyline. What would be an ideal approach to calculate the perpendicular offset points? Would I need to export/copy the longest edge of the polygon to a new FeatureClass before proceeding? Any leads on a possible workflow would be very helpful.
... View more
02-25-2020
05:04 PM
|
0
|
0
|
218
|
POST
|
Resolved seeing angles were measured clockwise. Thanks to Dan.
... View more
02-24-2020
11:49 PM
|
0
|
0
|
2448
|
POST
|
Absolutely spot on, Dan. This was my first thought line and I could get the lengths of the polygon sides using: arcpy.MinimumBoundingGeometry_management(inFC, outFC,
geometry_type="RECTANGLE_BY_AREA",
group_option="NONE",
mbg_fields_option=True) The length and even orientation were computed after executing the above with split polylines (edges of the polygon) as the input Feature class. From there I wasn't sure what else I should be doing. Do you select the side with the longest line and then draw the perpendicular offsets at a static value or from the width values? I'm really not sure how to go about this. PS: The screenshot in the OP is one sample.
... View more
02-24-2020
04:20 PM
|
0
|
0
|
1728
|
POST
|
Thank you for this, Bruce. I am indeed aware of this tool but the current requirement is to script such a solution.
... View more
02-24-2020
03:04 PM
|
0
|
0
|
1728
|
POST
|
Thank you, Bruce, for the link. But not sure that gets me to my goal. Let me attempt to say it differently. So, the screenshot in the OP is a building footprint and the angles at the vertex aren't 90 degrees but should be -- digitizing error. I am now trying to adjust each corner which has angles such as 89.88 degrees to become 90 degrees. I am honestly not sure how to go about it and so I am in search of a solution.
... View more
02-24-2020
02:53 PM
|
0
|
2
|
1728
|
POST
|
I have converted polygon edges into polylines which I have also split at vertices. I am trying to rotate the polygon edges (segments) at angles which I have stored in a field in an attribute table. The angles I have are for the polygon vertices. How do I proceed with rotating the segments -- preferably by scripting? For instance, in the above image with a polygon, I need to move those 2 line segments until the angle between them are at right-angle and repeat same for all vertex/corners of the polygon. EDIT: Providing additional context
... View more
02-24-2020
12:36 PM
|
0
|
10
|
2144
|
POST
|
Thank you, Dan. This did work well in determining the polygon angles as well as polyline angles (arcpy.PolygonToLine_management() ). However, I was wondering how I would get to identify the vertex angle that it had computed. Currently, the above images show how the angles tally with the vertex using the COGO tool to investigate. Just as a note: Also, (guessing the numpy version on the machine is pretty old), I had to change line 12 to read as: w = np.where(np.is1d(part, None, invert=False))[0] I got this hint from here as I was having an "isin" error not found in numpy module. EDIT 1: Added more details to describe the result. EDIT 2: Added a more situational result. (New image with attribute table alongside geometry)
... View more
02-23-2020
03:12 AM
|
0
|
1
|
2448
|
POST
|
Thank you, Dan. To answer what the purpose is, I want to know the values of each polygon vertex and based on the value of inaccuracies with respect to expected values, I will be moving each side of the polygon (split into segments) to the expected values. For example, for corners which should be 90°, and I get 89.83°, I will need to rotate the line segment. So, my current question above is just the start step I will be needing. I will implement your suggestion above and revert once on my computer. Thank you!
... View more
02-22-2020
08:01 AM
|
0
|
3
|
2448
|
POST
|
Thank you Dan. Currently not on my computer but will try it out. However, how do I work with this with an input shapefile? A bit unclear on how to use.
... View more
02-22-2020
04:32 AM
|
0
|
5
|
2448
|
POST
|
Thank you for this Jeremy. This indeed computes vertex angle but I was looking for a solution for a closed geometry (Polygon) as this is the major issue for me.
... View more
02-21-2020
09:42 PM
|
0
|
0
|
2448
|
POST
|
The goal is to find the angle at each vertex. My current computation which started with the clue I got here, isn't giving me the expected vertex angle values. By expected values, I mean angles at vertex measured using ArcMap10 COGO tool. inFC (input feature class) are polylines which were a result of polygon split operation. I am also not getting it right with regards to pushing those angle values to the field "Angle" Alternate approaches are welcome. # get the vertex angle
def getVertexAngle(inFC):
arcpy.AddField_management(inFC,"Angle","DOUBLE")
pointer = 0
with arcpy.da.UpdateCursor(inFC, 'Angle') as uCur:
with arcpy.da.SearchCursor(inFC, 'SHAPE@') as sCur:
for row in sCur:
orient = []
Geom = row[0]
Parts = range(Geom.partCount)
for part in Parts:
currPart = Geom.getPart(part)
pointCount = currPart.count
qPointsRange = range(1, pointCount - 1)
for point in qPointsRange:
currPnt = currPart.getObject(point)
X = currPnt.X
Y = currPnt.Y
prevPnt = currPart.getObject(point - 1)
nxtPnt = currPart.getObject(point + 1)
radian = math.atan2(Y - prevPnt.Y, X - prevPnt.X) - math.atan2(nxtPnt.Y - prevPnt.Y, nxtPnt.X - prevPnt.X)
degrees = 90 - math.degrees ( math.radians( radian ) )
orient.append(degrees)
print degrees
print "orientations are: ", orient
return orient
... View more
02-21-2020
08:34 AM
|
0
|
9
|
2836
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|