Solved

Read big raster only once THAN clip using multiple extents via workspace runner

  • 20 February 2022
  • 5 replies
  • 4 views

Hello,

 

I'm still juggling with FME. I have this very large raster (30 Go) and I need to clip with over 2000 different shapefile extents. Right now, I have been trying to use a Feature Reader and set up a spatial filter to read only what intersects the selected shapefile. Unfortunately, the whole raster is always completely returned.

 

I have also tried creating a parent workspace only reading the main raster and creating a child workspace that would clip the raster according to the selected shapefile. The problem is that the raster is then read EVERYTIME in the child workspace (which amounts to about 72 hrs of unnecessary processing).

 

I have read somewhere that you can publish extent parameter and use it in a normal reader to apply a search by envelop and than clip. However, I can't seem to understand how to "call" the parameters in the reader as there are no way to input parameter (see picture below).

 

 image.pngWould anyone have a solution?

icon

Best answer by nielsgerrits 21 February 2022, 05:44

View original

5 replies

Userlevel 6
Badge +31

After you added the Reader, you can create or link user parameters to the reader parameters via the Navigator window:

Create User Parameter 

This is great! I didn't know you could set up parameters from there. Thank you @nielsgerrits​ 

I don't know if it's a good idea to add a follow-up question here, but here I go. Although the process explained previously did work, I'm still missing something. I have set up a workspace runner which basically just reads the raster and grabs the extent variable via the boundsExtractor. However, I can't seems to be able to access the actual raster. The inspector I added shows me the raster is indeed good but if I look at the "suceeded" output of the Workspace runner, it is just my shapefile output.

 

WorkspaceRunner limit raster boundworkspaceRunner output 

Userlevel 6
Badge +31

I don't know if it's a good idea to add a follow-up question here, but here I go. Although the process explained previously did work, I'm still missing something. I have set up a workspace runner which basically just reads the raster and grabs the extent variable via the boundsExtractor. However, I can't seems to be able to access the actual raster. The inspector I added shows me the raster is indeed good but if I look at the "suceeded" output of the Workspace runner, it is just my shapefile output.

 

WorkspaceRunner limit raster boundworkspaceRunner output 

The inspector is only for visualization .

You either need to process the raster in de the child workspace or write the clipped raster by the child workspace and read it with the parent workspace.

The second option feels more like a FeatureReader with the clip to envelope option but will be slower due to the extra I/O writing the result and reading it back, but it performs nice in my test.

Perfect! Thank you so much for taking the time to image/exemplify this!

Reply