Skip to main content

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?

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).


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


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

 

 


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...

 

 


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.

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


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 :-)

 

 


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