Question

Is there any way to use FME Desktop to square (true) polygon corners to 45 or 90 degrees?

  • 14 November 2021
  • 3 replies
  • 18 views

Badge

I have about 500,000 building footprints that are collected to varying degrees of accuracy. I would like to true these footprints so the corners are either 45 or 90 degrees on the polygons as depicted below. Is there a means to do this using FME desktop? The corners are typically within +/- 5 to 10 ground units of being true.

 

Before:

BeforeAfter:After


3 replies

Badge +14

I was wondering this as well. Does anyone know how it is done?

Userlevel 4
Badge +36

Maybe something like this:

  1. Create the 2D Oriented Bounding Box of the feature (BoundingBoxReplacer)
  2. Calculate the azimuth of one side of this Bounding Box
  3. Convert the original polygon to segments of 2 points (Chopper)
  4. Calculate the azimuth of every segment
  5. If the azimuth of a segment is close enough to the azimuth of the bounding box (or close enough to this azimuth +/- 90 or 180 degrees, or - if you want to - close enough to this azimuth +/- 45 degrees or +/- 135 degrees), rotate the segment around it's middle point to the desired azimuth
  6. Calculate the intersection point of every pair of adjacent segments
  7. Re-create the polygon from the intersection points

Ensure the polygons have no corners of (approximately) 180 degrees.

Make sure every original polygon has a unique ID, and use Group By on this ID where this applies.

Userlevel 4
Badge +36

An implementation of the process mentioned above (not thoroughly tested!):

Make Rectangular_workspaceThe workspace uses a simplified version of the HorizontalAngleCalculator from FME Hub.

Reply