Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a set of detached building polygons and i can merge them together in order to form a single building polygon. However, when merged output polygon may not preserve the orthogonality of building sides depending on the orientation of the original detached polygons. In order to make the sides of merged building orthogonal, is there any open-source building squaring algorithm/ tool?

share|improve this question
This is a follow on question to this… The first answer to that question directly addresses orthogonal vs non-orthogonal datasets. – Get Spatial May 11 '12 at 9:30
Please follow up on your previous question instead of opening a duplicate. – underdark May 11 '12 at 9:50
Is it really a duplicate? This question asks for a squarring algorithm, while the other one is for an amalgamation algo. – julien May 11 '12 at 9:52
Yes, this is not a duplicate question. You can see the result of the aggregation of a set of buildings into one building with orthogonal option does not preserve orthogonality. – Sanjeewa May 11 '12 at 9:57
If I understand the question correctly, the first answer to the previous question addresses orthogonal merging it already. It seems necessary to explain how this is different, probably with a sketch. – underdark May 11 '12 at 10:02
up vote 3 down vote accepted

There is such polygon squaring algorithm in the opencarto java lib. Have a look at the class Squaring of the opencarto-server module. This algorithm is quickly described in this paper.

Good luck!

share|improve this answer
Hi Julian, More details of the paper? Is it published? I need to cite it. – Sanjeewa May 11 '12 at 17:29
@Sanjeewa, since the link that was provided to the paper is from a conference, and the path references proceedings, it is at least published in one form, though maybe not a journal. As for other details, the entire paper is in the linked pdf, with contact info on the first page and references on the last. You should be able to cite it based on the information contained therein. – Get Spatial May 11 '12 at 17:58

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.