Skip to main content
Question

Polygon Vertex

  • April 25, 2017
  • 12 replies
  • 599 views

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.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

12 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3430 replies
  • 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+22
  • Contributor
  • 2179 replies
  • 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
  • 2252 replies
  • April 25, 2017

or simply Chopper by Maximum vertices =1.


verdoodtdries
Supporter
Forum|alt.badge.img+22
  • Supporter
  • 53 replies
  • April 26, 2017

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
  • 4 replies
  • May 2, 2017

or simply Chopper by Maximum vertices =1.

Thank you, may I know any setting on it?

 


  • Author
  • 4 replies
  • May 2, 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.

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
  • 4 replies
  • May 2, 2017

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
  • 4 replies
  • May 2, 2017

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+18
  • Supporter
  • 1442 replies
  • May 2, 2017
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
  • 8394 replies
  • May 2, 2017
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
  • 5 replies
  • June 29, 2018
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
Celebrity
  • 7843 replies
  • June 30, 2018
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.