Skip to main content

May I know that how to export each vertex from a geometry?

I tried to use Vertex Creator before, but the output is not one record for one point, but one record for all points.

For example, there is a polygon with 4 vertex,

The result I want to get like this:

Pointxy1xxxxxxxxxxxx2xxxxxxxxxxxx3xxxxxxxxxxxx4xxxxxxxxxxxx

 

but not like this:

Polygonx1y1x2y2x3y3x4y41xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Is there any function can help me solve this case?

Thank you.

Coordinate extractor extracting all coordinates followed by a list exploder. Note that vertex numbers start from 0 not 1


I would use the CoordinateConcatenator first (to create a concatenated list, using comma as ordinate and semi-colon as vertex seperator).

Then use the AttributeSplitter to create a list (splitting on semi-colon).

The ListExploder will give you a feature per list item (these will be the points).

The second AttributeSplitter (split on comma) will give you the X and Y coordinates as attributes.

That is a lot of typing.

An easier way:

Use the Chopper to create vertices.

Use the CoordinateExtractor to extract X and Y to attributes.

Should have thought of this one first.


or simply Chopper by Maximum vertices =1.


Another method is to use the FME Objects Python API: https://docs.safe.com/fme/html/FME_Objects_Python_API/index.html. I would recommend to use this option if you're familiar with Python.

Within the class FMEPolygon you can use the inherited function bounds() which returns a tuple of FMEPoint objects. Next you can loop over this tuple and return each point. Finally remove duplicate points if necessary.


or simply Chopper by Maximum vertices =1.

Thank you, may I know any setting on it?

 


I would use the CoordinateConcatenator first (to create a concatenated list, using comma as ordinate and semi-colon as vertex seperator).

Then use the AttributeSplitter to create a list (splitting on semi-colon).

The ListExploder will give you a feature per list item (these will be the points).

The second AttributeSplitter (split on comma) will give you the X and Y coordinates as attributes.

That is a lot of typing.

An easier way:

Use the Chopper to create vertices.

Use the CoordinateExtractor to extract X and Y to attributes.

Should have thought of this one first.

Thank you, may I know any setting?

 

As I can proceed CoordinateConcatenator and get the result of

 

BuildingIDCoordinate 1xxxxxx , xxxxxx , xxxxxx ; xxxxxx , xxxxxx , xxxxxx ;........

 

 

 


Another method is to use the FME Objects Python API: https://docs.safe.com/fme/html/FME_Objects_Python_API/index.html. I would recommend to use this option if you're familiar with Python.

Within the class FMEPolygon you can use the inherited function bounds() which returns a tuple of FMEPoint objects. Next you can loop over this tuple and return each point. Finally remove duplicate points if necessary.

Thank you, will try this method later.

 

 


Coordinate extractor extracting all coordinates followed by a list exploder. Note that vertex numbers start from 0 not 1

Thank you for your help.

 

 


Thank you, may I know any setting on it?

 

 

Setting it to 1 on the Maximum Vertices will result in point features, setting it to two will reslut in lines with maximal 2 vertices etc, etc see the help for more detailed information about the transformer.

 


Thank you, may I know any setting on it?

 

What exactly do you need? Your OBJECTID will be the equivalent of a polygon id, whereas the "chopped" attribute will contain the vertex number in each polygon.

 

If you need the X/Y values you can use the CoordinateExtractor after the Chopper, as mentioned below.

 


What exactly do you need? Your OBJECTID will be the equivalent of a polygon id, whereas the "chopped" attribute will contain the vertex number in each polygon.

 

If you need the X/Y values you can use the CoordinateExtractor after the Chopper, as mentioned below.

 

Maybe I'm missing something but chopped attribute will contain yes or no... not the vertex number.

 

 


Maybe I'm missing something but chopped attribute will contain yes or no... not the vertex number.

 

 

You are right, the Chopped Indicator Attribute just indicates if the output feature was chopped (yes) or not (no).

 

If you need to add index attribute to the output features, consider using a Counter additionally. Or, the VertexExtractor (from Hub) might help you.