Question

How to download multiple TIF Images from a URL saved in a Shapefile.

  • 5 November 2021
  • 2 replies
  • 72 views

Badge

I have a shapefile in which the download URLs of many tiff images are written in the attribute "RGB". I have to download all tiffs and save to my filesystem.

 

I first tried with the HTTPcaller transformer which downloaded the files but named them all after the header description. I couldn't find a way to determine the filename in the transformer when "save response Body to" was set to "file".

 

Then I saw a post from Takashi in which the FeatureReader transformer was used to download files. This downloads the files into an fme-Temp directory and I am able to name the indivual files according to an attribute in the Shapefile, but after the transformer has done it's work, all the tiffs are automatically deleted.

 

Unfortunately I have no idea what's doing on here but i'm sure i'm only a short step away from being able to download the tiff files to a directory of my choice with the correct filename.

 

Could anyone show me what i'm forgetting?

 

DownloadTiffs


2 replies

Userlevel 6
Badge +32

I would just use the HTTPCaller, but upstream of it you need to define the path you want to write to for each record in the shape, based off the filename in the rgb column.

 

You can do this with an AttributeCreator transformer. Then feed that attribute in the HTTPCaller.

 

2021-11-05_10h56_23 

Userlevel 4
Badge +25

@nielsgerrits​ has the correct solution here - but to illustrate it I made this one of my question-of-the-week and added it to a video here: https://youtu.be/uyF7MEuBdK0

Reply