Skip to main content
Question

Scale and move one bounding box to be within another

  • May 21, 2013
  • 4 replies
  • 14 views

Hi,

 

 

As the title, I start with a box which I eventually split into tiles. This box needs to be scaled, possibly moved all whilst maintaining the aspect ratio to fit into the reference box.

 

 

How should I proceed?

 

 

Cheers,

 

 

 

 

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.

4 replies

takashi
Celebrity
  • May 21, 2013
Hi,

 

 

Using the BoundsExtractor, you can get xmin/max, ymin/max values of a bounding box. In addition, if your final purpose is the tiling processing, the Tiler might help you without scaling.

 

 

Takashi

takashi
Celebrity
  • May 21, 2013
... if 'scale' means 'make a box bigger or smaller', have a look at the Scaler transformer.

david_r
Celebrity
  • May 21, 2013
Hi,

 

 

to add to Takashi's suggestions: you can use the Offsetter to move your features given a relative offset distance (delta).

 

 

David

  • May 21, 2013
Hi Pat,

 

 

Not exactly knowing what you want to do with the boxes, but from my own practical experience: not managing the box boundaries, but managing the centroid with scale and aspect ratio (and a derived function delivering you the box dimensions), gives a much simpler approach and delivering a  robust code solution.

 

 

Marc