Question

Creating a perfectly square bounding box for geometries

  • 20 June 2018
  • 1 reply
  • 21 views

Badge

Hi there,

I need to generate some raster images based on shape file data, but I'm having issues with creating a bounding box for my edges that is always square.

Here's an example of some of my data:

When I use the BoundingBoxAccumulator, it gives me a rectangular polygon, which is entirely expected as the above geometry frame is much higher than it is wide.

Ideally, I'd like my bounding box to use the biggest one of the two for both the height and width, so that the polygon is still based on the size of the Geometry, but always perfectly square.

Any suggestions on how I might achieve that?

Thanks,


1 reply

Userlevel 4

You can use the BoundsExtractor to get the height/width of your geometry, then find the maximum value using e.g. an ExpressionEvaluator and pass the result on to a 2DBoxReplacer.

Reply