Skip to main content

Hello, I want to cut raster data with a shape data. There are 10 objects in the shape data and 10 raster data. Sometimes the objects in the shape data overlap. There is a column in the shape data that contains the names of the raster data. I want to cut each raster data with only the object with this name. I couldn't find the result despite trying very hard. I am using the clipper transformer. If you have any advice on this subject, I would be very happy.

You will need to expose the fme_basename attribute on the raster reader, which should be the name of the raster file. Using an AttributeCreator, create a new attribute on the raster features that matches the column in the shapefile. Give this new attribute the value of fme_basename. In the Clipper transformer, use the Group Processing parameter set to the name of the column. This will only clip those features with matching column names.


Hi,

If your shp files and raster files have common attribute - name of the raster data, use Group processing by that attribute, example:

 


Thank you very much for the response. I have actually tried both of the suggestions above, but they didn’t work. What I’m trying to do is remove the black areas that appear around the raster data. These areas are only visible in ArcMap; they don’t appear in ArcGIS Pro. I also tried to remove these areas using the RasterBandAdder transformer, but it didn’t work. Perhaps you have a solution that directly addresses this issue.


I have created a clip shape that only shows the area with the actual data. I want to use this shape file to clip the raster data.

I did this using the raster clip command in ArcMap, but it takes a very long time. Do you have any suggestions? Thank you!


How have you set up the parameters under the Raster Candidates part of the Clipper?


You can’t have rasters with irregular shapes, they have to be rectangular. You have to define those pixels as containing Nodata, which can then be rendered as transparent on the client. In the Clipper there’s a Nodata setting for raster clipping, or look into using the RasterBandNodataSetter.

You could also consider using the shape geometry to create a b/w raster and add it as the alpha channel to each raster. Finally, be sure to save the rasters in a format that preserves nodata and/or the alpha channel.

Here’s an article that should give you some pointers: https://support.safe.com/hc/en-us/articles/25407770118413-Setting-NoData-and-Adding-Alpha-Bands-to-Remove-Black-Borders


Thank you very much for the responses. The issue was resolved using the RasterBandNoDataSetter transformer.So I cut 75 raster data with a small operation. 

 


Reply