# Determining direction of longest segment of polygon using ArcGIS Desktop?

I have a shapefile with 9000 agriculture fields and what I like to do is to determine for each field (=each polygon) the direction of the longest segment. For instance, the selected polygon in the screenshot has its longest segment from west to east so I would like to mark give the polygon the attribute W (for west) or either E (for east).

Is there any solution to solve my problem in a fast but generalized way?

I do not need very detailed results. It's just for the interpretation of a question.

I'm seeking an answer using ArcGIS 10.2 for Desktop.

To be more precise on what I'm looking for I try to explain more practical: I'm doing winderosion analysis for a specific area with 9000 fields. As result I have a potential susceptibility for each field. I like to check, if the fields with high susceptibility are correlated to a certain orientation of the fields, e.g. check if most of the fields with high risk are oriented in the main winddirection or not.

The search for the longest segment is not really important for me. It was just an idea I had to determine the direction. So forget about the longest segment if there is a way to determine the direction with another method ;)

• I'm not sure what you're looking for. You say the direction of the longest segment, but given there can be many vertices on the longest side, are you actually looking for the direction of greatest extent? And you say either east or west - the highlighted polygon is longest east/west, but the western line is longer than the eastern line. Are you looking for whether a field is mostly longer east-west or north-south (and how detailed do you want that direction to be - just the four cardinals, or nw-se, etc.)? Jul 20, 2014 at 19:10
• I think you would be better replacing your picture with one of just a single polygon that illustrates more clearly what "segment" you are calling the longest.
– PolyGeo
Jul 20, 2014 at 21:43
• What you are asking for is an easy thing for a person to discern but a difficult task for a computer. You could try to centreline the polygons to get the trend line for the polygon or at the very least generalize/simplify the polygons so there's not so many vertices which should end up with straight lines for the sides. You would need to do some python to find the length of the segments though. It might work out better to use the extents (envelopes) of the polygons for your calculations. Jul 21, 2014 at 0:00
• I edited my question and hope to make it more precise. @Chris W: would be enough to get the four cardinals Jul 21, 2014 at 9:59