Skip to main content
Question

Creating a perfectly square bounding box for geometries

  • June 20, 2018
  • 1 reply
  • 151 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,

david_r
Evangelist

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings