Question

Creating polygons from points.

  • 19 March 2014
  • 5 replies
  • 186 views

Hello,

 

 

There is a point data, in which there are many which have identical concatenated attribute value. 

 

Trying to create a polygon of such points which have the identical attribute values and finding the centroid.

 

For which, the HullAccumulator (convex) was tried.

 

However, It does create the polygons but not in the cases where there are two points with identical attribute value it doesn't. requirement being, All the points which have these identical values need to create their respective polygon.

 

 

Regards.

5 replies

Badge +3
Hi,

 

 

I dont think areabuilder_type transformers can build a area or polygon from just 2 points....

 

 

 

2 points can form a line.

 

Maybe you could use a statisticscalculator to separate those and send them to a 2dPointreplacer/2DPointadder combo to build a line.

 

 

If u insist on forming an area from 2 points you can use a non-oriented boundingboxaccumulator.

 

(mind you, if the points lie on the vertical or horizontal, they will fail).

 

 

 

Gio

 

 

Userlevel 2
Badge +17
Hi Sani,

 

 

If your final goal is to find centroid (center of mass) of points which have identical attribute value, I think the Aggregator and the CenterOfGravityReplacer can do that.

 

 

Takashi
Thank You for the reply :)

 

 

Regarding seperating only the 2 points having identical attributes,

 

How to go about that?

 

 

 

Userlevel 4
Hi,

 

 

there are many ways to find the number of points having identical attributes, but it generally involves using the Group By on the shared attributes.

 

 

One way could be to use the StatisticsCalculator (with a Group By), as suggested by Gio.

 

 

David
Badge +7

I've done this with LineCombiner, but my data is structured in such a way that it will come out of the Polygon port of LineCombiner i.e. the last vertexes has identical coordinates to the start vertex.

Reply