Skip to main content

I got a dilemma Iam trying to solve, but after 2 days of constant hacking I cant figure out how to do it.

 

  • The script should run on fme server
  • User adds an excel-file that constantly changes, the column names containing the coordinates can be named whatever, the sheet can also have different types of coordinates.
  • Vertex creator to create points from coordinates

 

so the workspace need to handle those scenarios.

 

I tried adding two published user parameters where the user needs to type in the exact name of x or lat column and y or lon column. So my idea was to get the values from those columns and then clean the coordinates, replace . with , and other things. But the problem is I dont know how to get the values inside those columns.

 

I know fme cant know what attributes the file has but in this case the user already specified 2 columns so that should work?

 

Any ideas on how I can solve this problem?

 

If its not possible, the alternative must be 2 workspaces but I cant find any tutorial on how to do that.

 

I attached a simple excel-file.

Hi @essb​ ,

 

I think the ideal solution for this is similar to this on the FME Server Playground: https://community.safe.com/s/article/easygeocoder-data-driven-self-serve-data-transform

However, if you can't make that work, then I think you are close with your current process. In my solution, I included an additional parameter for what type of coordinates are in the file (northing/easting, lat/long - DD, lat/long - DMS, etc.). This helps me filter the request in the workspace to define what needs to be done to the coordinates.

parametersThe other important part was to have two readers set up from the same file. One XLSX reader and one SCHEMA reader. I then merge these two right away and create attributes from the parameters to then process and use in the VertexCreator transformer.

 

frontI hope that helps, let me know if I haven't explained it very well.


Hi @essb​ , if I understand your problem correct, here is a workflow:

Screenshot 2021-09-09 185726 

At the end you have the columns of your custom parameter columns:

Screenshot 2021-09-09 185809I hope that help you.


Hi @essb​ , if I understand your problem correct, here is a workflow:

Screenshot 2021-09-09 185726 

At the end you have the columns of your custom parameter columns:

Screenshot 2021-09-09 185809I hope that help you.

Hi I tried your suggestion but I cant really get it to work. I assue the RHS_2 and RHS_3 are user parameters where the user specify columns?


Hi @essb​ ,

 

I think the ideal solution for this is similar to this on the FME Server Playground: https://community.safe.com/s/article/easygeocoder-data-driven-self-serve-data-transform

However, if you can't make that work, then I think you are close with your current process. In my solution, I included an additional parameter for what type of coordinates are in the file (northing/easting, lat/long - DD, lat/long - DMS, etc.). This helps me filter the request in the workspace to define what needs to be done to the coordinates.

parametersThe other important part was to have two readers set up from the same file. One XLSX reader and one SCHEMA reader. I then merge these two right away and create attributes from the parameters to then process and use in the VertexCreator transformer.

 

frontI hope that helps, let me know if I haven't explained it very well.

Hi, thanks, seems to work so far. I will do some more tests with different schemas.


Hi @essb​ ,

 

I think the ideal solution for this is similar to this on the FME Server Playground: https://community.safe.com/s/article/easygeocoder-data-driven-self-serve-data-transform

However, if you can't make that work, then I think you are close with your current process. In my solution, I included an additional parameter for what type of coordinates are in the file (northing/easting, lat/long - DD, lat/long - DMS, etc.). This helps me filter the request in the workspace to define what needs to be done to the coordinates.

parametersThe other important part was to have two readers set up from the same file. One XLSX reader and one SCHEMA reader. I then merge these two right away and create attributes from the parameters to then process and use in the VertexCreator transformer.

 

frontI hope that helps, let me know if I haven't explained it very well.

Hi again

The solution works for Excel. Do you know of a similar solution that works for CSV files? I tried by just adding a CSV reader instead of the Excel-reader but I cant get that to work.


Reply