Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm looking for a script that will square the corners of polygons that are near 90 degrees but not exactly. Near could be dealt with via a variable, for example within 5 degrees of 90 (85 - 95 degrees).

For a more detailed description and some rather formal pseudo code, please refer to the following ESRI thread (particularly William Huber's post) :


share|improve this question
Note that the ESRI forums post includes a working spreadsheet, so there is code in addition to pseudocode. The crux of the matter is solving an optimization problem. ArcGIS doesn't have tools for this, but its add-ins (such as R and Python) do. It would be a fun little script to write for those with the skills...(which wouldn't include me: I'm not an ArcGIS programmer). –  whuber Jun 8 '11 at 20:20
The following thread on measuring the angles of the corners of a polygon is a step in the right direction - gis.stackexchange.com/questions/10535/… –  Brent Edwards Jun 9 '11 at 12:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.