Skip to main content
Question

Extract Polygon information

  • January 12, 2025
  • 6 replies
  • 50 views

boubcher
Contributor
Forum|alt.badge.img+11

Hello Guys 

I have a polygon  we need to know the length of each segment and which direction the segment is facing 
north , south , East or Ouest.

 

Thanks 

6 replies

danilo_fme
Evangelist
Forum|alt.badge.img+44
  • Evangelist
  • January 12, 2025

Hi ​@boubcher , how are you?

 

Could you share the polygons for us?

 

Thanks in Advance,

Danilo


david_r
Evangelist
  • January 13, 2025

You can use the Chopper (max vertices = 2) to divide the polygon into segments, then use the HorizontalAngleCalculator to get their individual orientation, and the LengthCalculator to get their length.


s.jager
Influencer
Forum|alt.badge.img+16
  • Influencer
  • January 13, 2025
david_r wrote:

You can use the Chopper (max vertices = 2) to divide the polygon into segments, then use the HorizontalAngleCalculator to get their individual orientation, and the LengthCalculator to get their length.

Use the GeometryCoercer first to ensure the polygons become lines, otherwise you’ll end up with smaller polygons.

Also be careful with the coordinate system in use: If that is not a projected one (ie you have lat/lon instead of x/y), the angle- and length calculations will be incorrect.

The PolylineAnalyzer might be the most elegant solution.


david_r
Evangelist
  • January 13, 2025
s.jager wrote:

Use the GeometryCoercer first to ensure the polygons become lines, otherwise you’ll end up with smaller polygons.

That isn’t necessary, the output from the Chopper will only contain lines if max vertices = 2.

Also be careful with the coordinate system in use: If that is not a projected one (ie you have lat/lon instead of x/y), the angle- and length calculations will be incorrect.

True, you can also use the GeographicLengthCalculator if that is an issue.

The PolylineAnalyzer might be the most elegant solution.

I wasn’t aware of that one, looks interesting. It seems to have the same issue as the LengthCalculator regarding ground units, however?


boubcher
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • January 13, 2025

@david_r 
could  you please explain how  output of the angle and the azimuth from the Angle calculator will give me the orientation  , Est ,West ,North and South 

Thanks 


david_r
Evangelist
  • January 13, 2025
boubcher wrote:

@david_r 
could  you please explain how  output of the angle and the azimuth from the Angle calculator will give me the orientation  , Est ,West ,North and South 

Thanks 

The azimuth values increase clockwise from the reference point of north (which represents zero degrees). So you could e.g. say that _azimuth values in the range 315-45 = North, 45-135 = East, etc.

Example:

Source: https://academic.brooklyn.cuny.edu/geology/leveson/core/linksa/comp.html


Reply


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