Skip to main content
Question

Polygon Vertex


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.

12 replies

ebygomm
Influencer
Forum|alt.badge.img+32
  • Influencer
  • April 25, 2017

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


erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • April 25, 2017

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.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • April 25, 2017

or simply Chopper by Maximum vertices =1.


verdoodtdries
Supporter
Forum|alt.badge.img+18

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.


  • Author
  • May 2, 2017
gio wrote:

or simply Chopper by Maximum vertices =1.

Thank you, may I know any setting on it?

 


  • Author
  • May 2, 2017
erik_jan wrote:

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 ;........

 

 

 


  • Author
  • May 2, 2017
verdoodtdries wrote:

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.

 

 


  • Author
  • May 2, 2017
ebygomm wrote:

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

Thank you for your help.

 

 


itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • May 2, 2017
aasonson wrote:
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.

 


david_r
Celebrity
  • May 2, 2017
aasonson wrote:
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.

 


olyster
Contributor
Forum|alt.badge.img+2
  • Contributor
  • June 29, 2018
david_r wrote:
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.

 

 


takashi
Influencer
  • June 30, 2018
olyster wrote:
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.

 


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