Skip to main content
Solved

Only loading in Raster data based on Area of Interest (from a GeometryReplacer and User Parameters)

  • August 30, 2024
  • 2 replies
  • 75 views

joku041199
Contributor
Forum|alt.badge.img+4

Hello, 

I am using FME 2022.2 and I’m trying to load in Raster data, based on an Area of Interest (AOI), specified by the end-user in FME Server (yes my organization is not using FME Flow yet, but the old FME Server). 

We have a few big Raster datasets on a local drive (of the entire Netherlands), which are loaded in as regular Readers. Then, using a Creator and GeometryReplacer, the end-user can specify an AOI (using a User Parameter), and the Rasters are then clipped in the Workspace using a Clipper. However, this means that the big Raster datasets need to be loaded/processed every single time the Workspace is ran, which is bad for performance. 

What I want, is that the Raster data is loaded into the Workspace, but only the data which intersects the AOI, specified by the end-user. 

I tried using a FeatureReader and use the AOI from the end-user as trigger to load in the Raster data. However, for some reason, the entire Raster dataset is loaded every time, instead of only the Raster data intersecting the AOI. I guess the FeatureReader is not friends with Raster data...

I cannot find a way to do this, any ideas? Thanks in advance :)

Best answer by david_r

What I’ve done in the past is to pre-process the rasters and generete BBOXes for each raster tile, e.g. using the BoundingBoxReplacer. Then I saved these BBOX polygons in a vector dataset with the raster tile filename as an attribute. This dataset remains (fairly) static.

When a user wanted rasters for a given polygon, I would overlay the user polygon with the BBOX polygons to isolate which tiles to deliver. This is much faster than reading the entire raster contents, especially for larger areas.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • Best Answer
  • August 30, 2024

What I’ve done in the past is to pre-process the rasters and generete BBOXes for each raster tile, e.g. using the BoundingBoxReplacer. Then I saved these BBOX polygons in a vector dataset with the raster tile filename as an attribute. This dataset remains (fairly) static.

When a user wanted rasters for a given polygon, I would overlay the user polygon with the BBOX polygons to isolate which tiles to deliver. This is much faster than reading the entire raster contents, especially for larger areas.


redgeographics
Celebrity
Forum|alt.badge.img+62

FeatureReader doesn’t clip raster, so what I usually do is use the FeatureReader with the option Bounding Boxes Intersect and then what comes out of that I clip to the area coming out of the GeometryReplacer, using a Clipper.