Question

Shrink / fit an object to another

  • 6 December 2013
  • 6 replies
  • 1 view

Userlevel 4
Badge +13
Hi There,

 

 

I have a set of lines I want to 'fit'/shrink into another object's bounding box.

 

Both features have the same LL coord.

 

I have tried the RubberSheeter and AffineWarper, but the result is just rotated.

 

 

Any help would be appreciated.

 

 

Itay

 


6 replies

Userlevel 4
Hi Itay,

 

 

I would try to calculate the difference in size ratios between the BBox and bounding box of the lines you want inside, then send the lines to the Scaler.

 

 

Could that work?

 

 

David
Userlevel 4
Badge +13
Hi David,

 

 

Yes it should, well  according to the docs it should, but when applying it I get a shift of the objects and not smaller objects.

 

 This is because the objects are not near the 0,0 point of the coordsys (again as stated in the documentation).

 

 

Do you know of any other way to "shrink" objects?

 

 

Itay

 

 

Userlevel 4
Badge +13
The AffineWraper is the right tool for this, unfortunately some of the features fail with an error message about the transformer  missing the minimal 4 control features needed. Any ideas on how to check and make sure all mecessary  inputs are available?
Userlevel 2
Badge +17
Hi Itay,   As David mentioned, I also think the Scaler can do that. But it will be necessary to move the coordinate system, so that the origin matches with left-bottom of the bounding box.   In other words, offset the target geometry before / after scaling. offset (-xmin, -ymin) --> scale --> offset (+xmin, +ymin).

 

(-xmin, -ymin) is left-bottom of the bounding box.

 

How's this?   Takashi
Userlevel 2
Badge +17
typo... orz

 

(xmin, ymin) is left-bottom of the bounding box
Userlevel 4
Badge +13
Hi Takashi,

 

 

Thanks for the explanation on how to use the scaler.

 

I have now the AffineWraper working and all of my features are being processed.

 

 

With a little help from FMEpedia (PDFTextMapper).

 

 

Itay

Reply