Solved

How to mirror raster?

  • 31 July 2017
  • 8 replies
  • 15 views

Badge +1

Here's one of them brain foods...

How to vertically flip raster?

Right now, my idea is to extract numbers of columns. Tile whole raster by number of columns (RasterTiler), offset them by _columns-column_number and mosaick them (RasterMosaicker). And that works...

But that can be a really long proces (depending on dimensions of raster). Does anybody have any less time consuming idea?

icon

Best answer by daveatsafe 31 July 2017, 20:14

View original

8 replies

Userlevel 2
Badge +17

Hi @zzupljanin, a possible way is to rotate 180 degrees with the Rotator and offset by (x = width, y = -height) with the Offsetter. The width and height of the raster can be calculated based on the extents extracted by the RasterPropertyExtractor (or BoundsExtractor).

Userlevel 2
Badge +17

Hi @zzupljanin,

The Affiner transformer can also mirror the raster, with the following coefficients:

A: 1

B: 0

C: 0

D: 0

E: -1

F: 0

Badge +1

Hi @zzupljanin,

The Affiner transformer can also mirror the raster, with the following coefficients:

A: 1

B: 0

C: 0

D: 0

E: -1

F: 0

Yes, thank you. This one works like a charm.

 

These are coef for horizontal mirroring. For vertical are: A:-1 E:1 B,C,D,F:0

 

 

Badge +1

Hi @zzupljanin, a possible way is to rotate 180 degrees with the Rotator and offset by (x = width, y = -height) with the Offsetter. The width and height of the raster can be calculated based on the extents extracted by the RasterPropertyExtractor (or BoundsExtractor).

Thanks, Takashi.

 

 

I don't think this is it. At least results aren't what I expected...

 

 

Userlevel 2
Badge +17
Thanks, Takashi.

 

 

I don't think this is it. At least results aren't what I expected...

 

 

I was wrong, the Rotator won't make a mirror image. The Affiner is the way to go.
Badge +8

Hi @zzupljanin, @takashi, @DaveAtSafe,

For georeferenced rasters you might want to put a BoundsExtractor before the Affiner and enter for parameter C the value:

@Value(_xmax)+@Value(_xmin)

(For the horizontal flip take parameter F and use the y values).

Like the attached workspace. This would compensate for the horizontal/vertical displacement of the transformed raster.

verticalflipgeoreferencedrasters.fmw

Badge +8

Hi @zzupljanin, @takashi, @DaveAtSafe,

For georeferenced rasters you might want to put a BoundsExtractor before the Affiner and enter for parameter C the value:

@Value(_xmax)+@Value(_xmin)

(For the horizontal flip take parameter F and use the y values).

Like the attached workspace. This would compensate for the horizontal/vertical displacement of the transformed raster.

verticalflipgeoreferencedrasters.fmw

On the other hand, why would anyone flip a georeferenced raster file :-)

 

 

Userlevel 5
Badge +25
On the other hand, why would anyone flip a georeferenced raster file :-)

 

 

I know some people who would be able to find a perfectly good reason to do that.

 

 

Reply