Skip to main content
Question

Adding centroid fields

  • November 23, 2012
  • 4 replies
  • 18 views

I want to compute a centroid for polygons then add the X and Y fields to my features.  I could not find any way of doing this in FME desktop as I have it. Can anyone suggest how I might do this please?

4 replies

takashi
Influencer
  • November 23, 2012
Hi,

 

I think that "CenterOfGravityReplacer" and "CoordinateExtractor" are applicable.

Forum|alt.badge.img+1
  • November 23, 2012
Hi, 

 

maybe  "insidepointreplacer"  then "pointonareaoverlayer" are better,  because centerofgravityreplacer generate the point could be outside of the shape.

takashi
Influencer
  • November 23, 2012
Yes. "CenterOfGravityReplacer" may generate a point outside of the original shape. I understood that "centeroid" means the center of gravity which can be outside of the shape. "CenterOfGravityReplacer" and "InsidePointReplacer", which is more suitable differs according to chrismugdan's demand.  

  • November 23, 2012
Hi,

 

Take your reader,

 

  branch

 

       InsidePointReplacer followed by CoordinatesExtractor

 

                                  ( very fancy to include reprojectors :) )

 

  Merge with original data

 

       FeatureMerger (The best of feature_ID)

 

 Write Results 

 

       Feature-writer

 

             copy attributes from input

 

             add your two X,Y attributes named in the CoordinatesExtractor

 

 

Good Luck

 

(failed to include a picture of the workbench)

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