Skip to main content
Question

Two user parameters let the user specify the columns containing x and y coordinates in a dynamic workspace where the schema changes everytime. Is it possible to expose the attribute values i the columns the user specified?

  • September 9, 2021
  • 5 replies
  • 27 views

essb
Contributor
  • Contributor

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.

5 replies

drc43
Contributor
Forum|alt.badge.img+11
  • Contributor
  • September 9, 2021

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.


connecter
Forum|alt.badge.img+4
  • September 9, 2021

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.


essb
Contributor
  • Author
  • Contributor
  • September 10, 2021
connecter wrote:

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?


essb
Contributor
  • Author
  • Contributor
  • September 10, 2021
drc43 wrote:

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.


essb
Contributor
  • Author
  • Contributor
  • September 23, 2021
drc43 wrote:

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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings