I am trying to use the Rcaller in FME to perform zonal statistics.
input: shapefile and a Geotiff
I read that the Rcaller reads the input data as a dataframe when it is imported into the Rcaller (R). So, I tried to convert the dataframes back to a shapefile (sp::SpatialPointsDataFrame) and a raster (raster::rasterFromXYZ).
However, I get an error,
X and Y coordinates are missing
I cannot figure out how I could add the X & Y coordinates to the input dataframe, and I am wondering if it is even possible to use a shapefile and raster as input for the Rcaller?
Or does anybody else knows a better way to perform zonal statistics in FME?
I also got an answer from Safe:
You can't load a raster/image directly into the RCaller data frame. You have >to read your raster directly in your R script. It would be similar to writing a >raster, as illustrated in this kriging example. Alternatively, you could covert >your raster to points using RasterCellCoercer / RasterToPointCoercer, but this >could be pretty slow depending on the size of your raster