Question

Use HTTPCaller to download file, to use in my workflow

  • 10 May 2023
  • 8 replies
  • 63 views

I want to create a workflow that downloads a file from the internet (SHP file compressed as ZIP file). That file should then be used in my workflow for further analysis and processing.

 

How should I set that up? I now have a "Creator", followed by a 'HTTPCaller'. This HTTPCaller downloads my ZIP file (contains a SHP file). How can I now use this data for further processing? When I use a ESRI SHP File Reader, I can't seem to send this file as an input to that Reader?

 

 


8 replies

Userlevel 2
Badge +12

You can use the transformer FeatureReader to read your SHP-File after download.

Userlevel 5
Badge +29

You can use the transformer FeatureReader to read your SHP-File after download.

Also make sure your are saving your response body to a file/folder. The path you pass to the FeatureReader will be the "_reponse_file_path" attributeimage 

Userlevel 4
Badge +36

You can use the transformer FeatureReader to read your SHP-File after download.

If you don't want to save the response body permanently, insert a TempPathnameCreator before the HTTPCaller. Store the downloaded zip file in the path created by this transformer. That way, the downloaded data will automatically be removed at the end of the workspace.

TempPathnameCreator_HTTPCaller_FeatureReader

You can use the transformer FeatureReader to read your SHP-File after download.

FeatureReader does the trick! That's an awesome transformer. Thanks.

Also make sure your are saving your response body to a file/folder. The path you pass to the FeatureReader will be the "_reponse_file_path" attributeimage 

Good tip, thanks, just what I needed.

If you don't want to save the response body permanently, insert a TempPathnameCreator before the HTTPCaller. Store the downloaded zip file in the path created by this transformer. That way, the downloaded data will automatically be removed at the end of the workspace.

TempPathnameCreator_HTTPCaller_FeatureReader

Great suggestion too. Learning so much today!

Userlevel 4
Badge +26

Depending on how you are getting the URL you can also just read directly from a URL in either the feature reader of normal reader.

 

image

Depending on how you are getting the URL you can also just read directly from a URL in either the feature reader of normal reader.

 

image

thanks, will keep that in mind, i might need that

Reply