Skip to main content
Solved

How to mirror raster?


zzupljanin
Contributor
Forum|alt.badge.img+4

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?

Best answer by daveatsafe

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

View original
Did this help you find an answer to your question?

8 replies

takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • July 31, 2017

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


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • July 31, 2017

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


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 1, 2017
daveatsafe wrote:

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

 

 


zzupljanin
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • August 1, 2017
takashi wrote:

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

 

 


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • August 1, 2017
zzupljanin wrote:
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.

helmoet
Forum|alt.badge.img+8
  • August 1, 2017

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


helmoet
Forum|alt.badge.img+8
  • August 1, 2017
helmoet wrote:

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

 

 


redgeographics
Celebrity
Forum|alt.badge.img+48
helmoet wrote:
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


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