Skip to main content

I have a JPG image and a CSV file with data that can be used to geo-reference it (attached).

I've built a Workspace to apply the geo-referencing data to the JPG. AttributeManager makes FactorY a negative number as I found I needed to do this when working out the process using ArcGIS. In the RasterGeoferenencer, I've selected the relevant fields from the CSV file as shown in the screenshot. OutX and OutY are the Ordnance Survey Eastings and Northings.

When I run the Workspace in FME 2017.0.1.1 (64-bit), I get the following error:

2017-06-08 15:39:10| 0.8| 0.0|ERROR |@GeoreferenceRaster: Failed to retrieve X Upper Left Coordinate parameter

I've tried setting the coordinate system on the JPG Reader and/or the CSV Reader, and setting OutX and OutY to x_coordinate and y_coordinate in the CSV Reader and then as real32. None of these make a difference.

Any ideas?

OK I've noticed one issue - the JPG data was reaching the RasterGeoreferencer and being processed before the CSV data was read. So I tried moving the CSV Reader above the JPG Reader and putting a FeatureHolder in before the RasterGeoreferencer..

However, I now get the following error:

2017-06-08 16:05:19| 1.0| 0.0|ERROR |@GeoreferenceRaster: Failed to obtain raster from feature. Only features with raster geometry are expected

I presume this referring to the CSV data. So how do I use the CSV data in the RasterGeoreferencer? Turn the relevant attributes into parameters?


I can convert the CSV file data into a JPGW World File in one Workspace and the subsequent raster processing I want to do in another but I thought I might be able to do it all in one Workspace...


I can convert the CSV file data into a JPGW World File in one Workspace and the subsequent raster processing I want to do in another but I thought I might be able to do it all in one Workspace...

Eventually I'll need to process a batch of images, and clip them using a polygon which is stored as WKT in the CSV. So maybe I'll have one Workspace that creates the World Files and clipping polygons, and another than clips the rasters.

 

 


Hi @tim_wood, I think the raster feature should have the attributes that store parameter values to be set to the parameters such as the X Upper Left Coordinate etc.

You can use the FeatureMerger to unconditionally merge the attributes storing parameter values, which are held by a feature coming from the CSV reader + AttributeManager. To perform unconditional merging, set an identical constant value (e.g. 1) to the "Join On" parameter for both Requester and Supplier. e.g.

Hope this helps.


Hi @tim_wood, I think the raster feature should have the attributes that store parameter values to be set to the parameters such as the X Upper Left Coordinate etc.

You can use the FeatureMerger to unconditionally merge the attributes storing parameter values, which are held by a feature coming from the CSV reader + AttributeManager. To perform unconditional merging, set an identical constant value (e.g. 1) to the "Join On" parameter for both Requester and Supplier. e.g.

Hope this helps.

Thanks. I'll give that a go.

 

In a batch processing scenario I presume I would join on the image name from the CSV = fme_basename from the JPG...?

 

 


Hi @tim_wood, I think the raster feature should have the attributes that store parameter values to be set to the parameters such as the X Upper Left Coordinate etc.

You can use the FeatureMerger to unconditionally merge the attributes storing parameter values, which are held by a feature coming from the CSV reader + AttributeManager. To perform unconditional merging, set an identical constant value (e.g. 1) to the "Join On" parameter for both Requester and Supplier. e.g.

Hope this helps.

If the CSV table has multiple rows and has a column which stores corresponding JPEG file name for each row, you can use the fme_basename (Requestor) and the column (Supplier) as Join On attribute to merge the attributes of a CSV feature to a JPEG feature.

 


If the CSV table has multiple rows and has a column which stores corresponding JPEG file name for each row, you can use the fme_basename (Requestor) and the column (Supplier) as Join On attribute to merge the attributes of a CSV feature to a JPEG feature.

 

Yes I tried that and it works although I have to set Rejected Feature Handling to "Continue translation" in the Workspace Parameters in order to get it to work. The CSV file has data for more rasters that I'm reading with the JPG Reader but I thought CSV records that didn't find a matching raster would simply come out the UnusedSupplier port.

 

I haven't had to change the Workspace Parameters when using FeatureMerger before but I think in previous scenarios it was always the other way round i.e. there might be Requestors that didn't have a match in Suppliers, but Suppliers would always find a match in Requestors.

 


If the CSV table has multiple rows and has a column which stores corresponding JPEG file name for each row, you can use the fme_basename (Requestor) and the column (Supplier) as Join On attribute to merge the attributes of a CSV feature to a JPEG feature.

 

Hi, you have found a solution? I faced similar problem(


Reply