POST
|
Many thanks, Dan, for your very useful suggestions and interests in this questions!
... View more
04-18-2018
08:34 AM
|
0
|
0
|
373
|
POST
|
Here is my solution in Python script: import math # group vertexes into four edges, for rectangles only with less than 10 degree slope of horizontal edges dflag=-1 # sides=[] for i in range(0,4): sides.append([]) #0: south,1:north,2:west,3:east apnts=row[1].getPart(0) # points of one polgyon for i in range(1,len(row[1].getPart(0))): a=math.atan((apnts.Y- apnts[i-1].Y)/( apnts.X- apnts[i-1].X)) ad=math.degrees(a) if abs(ad)<10: if apnts.Y<row[1].trueCentroid.Y: dflagn=0 else: dflagn=1 else: if apnts.X<row[1].trueCentroid.X: dflagn=2 else: dflagn=3 if dflag!=dflagn: sides[dflagn].append(apnts[i-1]) dflag=dflagn sides[dflagn].append(apnts)
... View more
04-18-2018
08:19 AM
|
1
|
3
|
373
|
POST
|
A case for this question: need to group all vertexes (gree and red points, the red is starting point) into four edges, top , bottom, lef and right edge.
... View more
04-17-2018
10:28 AM
|
0
|
1
|
1749
|
POST
|
Thank you so much for your reply. Now I am trying to use distance and direction at the same time to fix the corner case. Actually, in my case all polylines are "rectangle" shape which has four edges, 2 vertical and 2 horizontal, each edge is composed of 5 points, regularly distributed. Also, the rectangle has similar size, that is why I tried to use the distance to the extent of the rectangle to group points into four edges. Now, the question is how to fix the question in case of a rectangle with an uncertain number of points and locations. Many Thanks.
... View more
04-05-2018
03:13 PM
|
0
|
2
|
1749
|
POST
|
Hi Dan, Thank you very much for your ideas for retrieve the edges of polgyline. I tried to use the extent to calculate the distance between each point and the edge of extent, it works very well except the situation in which points are very close in the corners because I just used simply a constant distance as the valve.
... View more
04-05-2018
01:31 PM
|
0
|
4
|
1749
|
POST
|
Hi everyone, here is a question, how can I know relative position of each edge of rectangle with arcpy script, i.e, top edge, bottom edge, left edge and right edge. The rectangle is defined at least 4 points,maybe 8 points,that means uncertain points. and then I need to know which edge any point is on. thank you.
... View more
03-19-2018
12:46 PM
|
0
|
14
|
2657
|
Title | Kudos | Posted |
---|---|---|
1 | 04-18-2018 08:19 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|