Question

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

  • 8 November 2022
  • 3 replies
  • 13 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

Userlevel 1
Badge +21

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)))

 

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.  

Userlevel 1
Badge +21

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.

Reply