Solved

Add image on top of raster

  • 10 September 2019
  • 6 replies
  • 15 views

I have a workbench that creates an ECW wind heat map from a TIFF file. I have now created another image (png, JPEG or BMP) as a legend that I want to place on top of the ECW heat map, at a specific location. I was unable to find a way to do this, but may be missing an easy way to do this? Two steps are required.

1. Place the legend image on top of the ECW heat map.

2. Place it at a specific position and at a specific size before finalising the ECW image.

 

Any help on how to do this would be much appreciated.

icon

Best answer by gio 10 September 2019, 16:08

View original

6 replies

Userlevel 4

I'm certain someone can come up with a more complete solution, but look into the following transformers

  • BoundsExtractor, to get the coordinate extents of the heat map raster
  • RasterGeoreferencer to place the legend somewhere within the heat map
  • RasterMosaicker to blend the heat map with the legend. Be sure to set Overlapping Values = Last, and make sure that the legend arrives after the heat map.

 

Badge +3

@francois_binnem

Hi.

 

Yes, use a boundsextractor on both the heatmap and the logo. Make sure to name the x,y coordinates differently.

Scale the logo to your liking. Using the extracted bounds. (or eyeball it)

Boundsextract the logo again (as you have scaled it)

Use an affiner to move the logo box to where you want it.

If you write straight to a rastertype you need to sort them (counter and sort),

If you use a Mapnikrasteriser you can have the drawingorder set in that.

 

 

Userlevel 4

@francois_binnem

Hi.

 

Yes, use a boundsextractor on both the heatmap and the logo. Make sure to name the x,y coordinates differently.

Scale the logo to your liking. Using the extracted bounds. (or eyeball it)

Boundsextract the logo again (as you have scaled it)

Use an affiner to move the logo box to where you want it.

If you write straight to a rastertype you need to sort them (counter and sort),

If you use a Mapnikrasteriser you can have the drawingorder set in that.

 

 

The MapnikRasterizer is a great suggestion, it replaces the RasterMosaicker (in my answer) and is a lot more flexible.

Badge +3

@francois_binnem

Hi here is a example.

Move_Logo.fmwt

Moves a smaller logo to center of bigger pic.

@francois_binnem

Hi here is a example.

Move_Logo.fmwt

Moves a smaller logo to center of bigger pic.

Hi gio and david_r

 

Thank you very much for the suggestions, as well as the workbench example. I am trying to implement this in my solution but currently have a huge loss in quality of the wind heat map. It may be due to my setup, so I am still fiddeling with it. I will let you know if I can resolve it or have more questions. Just want to try to figure out what is going wrong right now.

@francois_binnem

Hi here is a example.

Move_Logo.fmwt

Moves a smaller logo to center of bigger pic.

Hi gio and david_r

I managed to figure out what the issue with the quality was. The MapnikRasterizer has a cell spacing property which I have set to 0.001, which resolved that. I also found that I did not require the FeatureMerger transformer. But Gio's example gave the answer I needed. Thanks a lot - appreciated!

Reply