Sunday, 17 January 2016

geometry - Calculating bearing of building using ArcGIS Desktop?


Is it possible to get the main bearing of buildings by floor plan?


I want to have a building (by ID) and it's main bearing (e.g. E/90° or W/270°). The idea is to change the polygon-feature class into a line-feature class. Then I can calculate the lengths of each side. I can also calculate the bearing of each side. Buildings with a more complex floor plan I planned to cumulate the side's lengths on the bearing.


The problem is that one building with four parallel sides get four different bearings because of the starting point for the bearing-calculation (see image). Furthermore the calculation doesn’t always start at the same end of a line.


Little Sketch



Answer



ArcGIS version 10 has "Minimum Bounding Geometry" in Data Management, Features toolset. I see an option RECTANGLE_BY_WIDTH that produces a new field MBG_Orientation—The orientation of the longer side of the resulting rectangle. If this doesn't give you the correct orientation, there is also "Update COGO attributes", for each line. You can then use Summary Statistics or arcpy.Statistics_analysis to get the angle of the Max Length, for each polygon ID.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...