Question

XY Coordinate

  • 5 January 2024
  • 4 replies
  • 27 views

Badge +4

 

hello everyone

 

I want to produce a point from this data in text format and the XY values ​​I need are in a single stub. The FME dataset area is common for x and Y. I will bring these XY values ​​side by side and produce a point from the vertex creator, but I did not know how to do this.


4 replies

Userlevel 2
Badge +17

Hi @bayram​,

You can use an Aggregator transformer to group the records by fme_dataset, creating a list of the fme_text_string values. Then you can search that list with ListSearchers, using regular expressions to extract the x (1[0-9]+[.]*[0-9]*m) and y (3[0-9]+[.]*[0-9]*m) coordinates. Remove the 'm' from the coordinates using a StringReplacer, then create points using a VertexCreator.

Screen Shot 2024-01-05 at 9.40.02 AMI am attaching a workspace stub to illustrate.

Badge +4

Hi @bayram​,

You can use an Aggregator transformer to group the records by fme_dataset, creating a list of the fme_text_string values. Then you can search that list with ListSearchers, using regular expressions to extract the x (1[0-9]+[.]*[0-9]*m) and y (3[0-9]+[.]*[0-9]*m) coordinates. Remove the 'm' from the coordinates using a StringReplacer, then create points using a VertexCreator.

Screen Shot 2024-01-05 at 9.40.02 AMI am attaching a workspace stub to illustrate.

 

Hello @daveatsafe​ 

 

Thank you very much for the answer, but I could not remove the values ​​from the list. I uploaded the excel data here. Can you help me if you have time?

 

1) xy values ​​in text string field

 

2) fme dataset field common field

 

I marked the xy values ​​with yellow color in Excel.

Userlevel 2
Badge +17

 

Hello @daveatsafe​ 

 

Thank you very much for the answer, but I could not remove the values ​​from the list. I uploaded the excel data here. Can you help me if you have time?

 

1) xy values ​​in text string field

 

2) fme dataset field common field

 

I marked the xy values ​​with yellow color in Excel.

OK, you have some other values in there that aren't coordinates, but are caught by the ListSearchers. We can tighten up on the regular expressions to solve this, changing them to 1[0-9]{5}[.][0-9]{3}m and 3[0-9]{5}[.][0-9]{3}m. This will only extract the true coordinate values.

I am attaching an updated workspace that incorporates your dataset.

Badge +4

 

Hello @daveatsafe​ 

 

Thank you very much for the answer, but I could not remove the values ​​from the list. I uploaded the excel data here. Can you help me if you have time?

 

1) xy values ​​in text string field

 

2) fme dataset field common field

 

I marked the xy values ​​with yellow color in Excel.

Thank you very much for your answer, it is very successful.

Reply