Skip to main content
Question

Scale and move one bounding box to be within another


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,

 

 

 

 

4 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • 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
Contributor
Forum|alt.badge.img+19
  • Contributor
  • May 21, 2013
... if 'scale' means 'make a box bigger or smaller', have a look at the Scaler transformer.

david_r
Evangelist
  • 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

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