Skip to main content

I have a polygon layer that was digitized manually and as a result, has some issues with overlaps and gaps. However, the first issue I would like to solve is making the polygons have right angles. They are all square or rectangle-type shapes so each vertex should have a 90 degree angle. Is there a way to manipultate the polgyons so that they are all at right angles? At this point, I would be able to check for snapping and other issues. Thanks!

Hi @geographygeek​ ,

I think you can use BoundingBoxReplacer to transform the polygons to perfect square or rectangular shapes whose corners are all 90 degrees.


Hi @geographygeek​ ,

I think you can use BoundingBoxReplacer to transform the polygons to perfect square or rectangular shapes whose corners are all 90 degrees.

Thanks for your suggesiton. It's not creating the right polygons. It is creating the bounding box, but my polygons represent buildings so they are not oriented in a way that this transformer would work. boundingbocx


Hi @geographygeek​ ,

I think you can use BoundingBoxReplacer to transform the polygons to perfect square or rectangular shapes whose corners are all 90 degrees.

The BoundingBoxReplacer has an option '2D Oriented Bounding Box' to create a rotated bounding box, oriented to the feature.

But based on the image you provided, that is also not what you are looking for.

 


@geographygeek​ , it's an interesting challenge.

Summary of my idea is:

  1. Create an oriented bounding box of the polygon, and split its boundary into individual edge lines.
  2. Split boundary of the original polygon into individual segments,
  3. Make each segment parallel to a bounding box edge which is closest in angle,
  4. Recreate polygon from the modified segments.

​Implementation is a bit complex, please see the attached workspace example to learn more.

Just be aware that a slight calculation error cannot be avoided, so the resulting corner angles may not strictly match right angle.


Nice solution!

@geographygeek​ reminded me that I once answered a similar question. I had competely forgotten that...


Nice solution!

@geographygeek​ reminded me that I once answered a similar question. I had competely forgotten that...

@geomancer​ Sorry for the late reply. I actually found that question and tried it out. It works....until the end.....so I extended the lines and used intersector to chop them and rebuild the polygons. It's working for MOST of the features but I still have some falling out. I tried to use the line builder and then a line closer for those that fall out of the intersector/snapper/area builder but those are not giving me good results. Part of the issue is with the original dataset which was done by students and has some geometric issues. So I created another workbench to fix up those issues prior to processing.

 

I just downloaded @Takashi Iijima​ 's workbench and I'll see if I can incorporate some of that. Stay tuned!


@geographygeek​ , it's an interesting challenge.

Summary of my idea is:

  1. Create an oriented bounding box of the polygon, and split its boundary into individual edge lines.
  2. Split boundary of the original polygon into individual segments,
  3. Make each segment parallel to a bounding box edge which is closest in angle,
  4. Recreate polygon from the modified segments.

​Implementation is a bit complex, please see the attached workspace example to learn more.

Just be aware that a slight calculation error cannot be avoided, so the resulting corner angles may not strictly match right angle.

ahh - the logic at the end of this is what I had built out (line extender/intersector/area builder). I'm going to tweak a bit and see where I get. I have a anchored snapper in there too from a previous step....I'm to going run without it and see what happens. Thank you!


Reply