Skip to main content
Question

Creating a perfectly square bounding box for geometries

  • June 20, 2018
  • 1 reply
  • 217 views

Forum|alt.badge.img

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,

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

david_r
Celebrity
  • 8394 replies
  • June 20, 2018

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.