Skip to main content
Question

Create Polygon from multiple (10) coordinates in CSV file.

  • November 8, 2022
  • 3 replies
  • 121 views

I have 10 long/lat coordinates, 1 in each column of a CSV file, with the headers listed as follows: Y1, X1, Y2, X2, Y3, X3, etc. The final two coordinates mirror the first two coordinates, so that the shape is closed. I am new to FME and am attempting to create a polygon from this CSV file and would love any guidance offered. Thank you.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • November 8, 2022

You could build the wkt using the columns and then use a geometry replacer to build the geometry from the well known text

POLYGON((@Value(x1) @Value(y1),@Value(x2) @Value(y2), @Value(x3) @Value(y3), @Value(x4) @Value(y4), @Value(x5) @Value(y5)))

 


  • Author
  • November 8, 2022
ebygomm wrote:

You could build the wkt using the columns and then use a geometry replacer to build the geometry from the well known text

POLYGON((@Value(x1) @Value(y1),@Value(x2) @Value(y2), @Value(x3) @Value(y3), @Value(x4) @Value(y4), @Value(x5) @Value(y5)))

 

Thank you for the response.  I have gathered that part of the sequence, but when my initial CSV is uploaded, do I need to change each of the column header type's to reflect a certain designation? Because it will not allow me to have multiple x/y types.  


ebygomm
Influencer
Forum|alt.badge.img+39
  • Influencer
  • November 8, 2022
kb5 wrote:

Thank you for the response. I have gathered that part of the sequence, but when my initial CSV is uploaded, do I need to change each of the column header type's to reflect a certain designation? Because it will not allow me to have multiple x/y types.

No, you shouldn't need to change the column types.


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