Skip to main content
Solved

Add image on top of raster

  • September 10, 2019
  • 6 replies
  • 64 views

fbinneman
Contributor

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.

Best answer by gio

@francois_binnem

Hi here is a example.

Move_Logo.fmwt

Moves a smaller logo to center of bigger pic.

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

6 replies

david_r
Celebrity
  • September 10, 2019

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.

 


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • September 10, 2019

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

 

 


david_r
Celebrity
  • September 10, 2019
gio wrote:

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


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • Best Answer
  • September 10, 2019

@francois_binnem

Hi here is a example.

Move_Logo.fmwt

Moves a smaller logo to center of bigger pic.


fbinneman
Contributor
  • Author
  • Contributor
  • September 11, 2019
gio wrote:

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


fbinneman
Contributor
  • Author
  • Contributor
  • September 13, 2019
gio wrote:

@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


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