Skip to main content
Question

Creating polygon using points stored in CSV


Forum|alt.badge.img+1
I have CSV file as input which holds xy co ordinates, I want to use these co ordinates to make polygon geometries which is to be written to oracle spatial.

 

 

Can anybody help me in choosing the right transformers for this process.

4 replies

fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • June 13, 2013
Hi,

 

 

Do you have an ID that defines the grouping of points into individual polygons?

 

If so then you can use the point connector (connection break attributes : ID).

 

 

Itay

 

 


david_r
Celebrity
  • June 13, 2013
Hi,

 

 

it depends on your CSV, but here are some starting points:

 

  • 2DPointReplacer to create points from a coordinate (X,Y) value 
  • 2DPointAdder to add another coordinate to an existing point so as to form a line, or to add a vertex to an existing line
  • LineJoiner to join separate line segments (hint: features must enter in the correct order, use a Sorter first).
  • LineCloser to close a line segment into a polygon
They are all documented in the FME Desktop help.

 

 

David

Forum|alt.badge.img+1
  • Author
  • June 13, 2013
The CSV I am talking about holds the co ordinates in 

 

 

Col1 (X1)  |  Col2 (Y1)  |  Col3 (X2)  |  Col4(Y2)

 

 

 

And I have to read the points using point1(x1,y1), point2(x1,y2), point3(x2,y2), point4(x2,y1)

takashi
Influencer
  • June 13, 2013
Hi,

 

 

you can do that based on David's suggestion. Try connecting these transformers in a series: 2DPointReplacer  X = col1, Y = col2 2DPointAdder  X = col1, Y = col4 2DPointAdder  X = col3, Y = col4 2DPointAdder  X = col3, Y = col2 LineColser (or 2DPointAdder  X = col1, Y = col2)

 

Takashi

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