I have 3D polygons where I need to calculate the aspect for each polygon and add it as attribute. Is there a way to do this? I found a transformer to calculate the aspect for raster but not for vector ,is there a way to go around? Thanks !
- Home
- Forums
- FME Form
- Transformers
- aspect calculation
aspect calculation
- October 4, 2018
- 18 replies
- 128 views
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, 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.
18 replies
- Safer
- 1633 replies
- October 4, 2018
Hi @irene2018,
You can use the FaceReplacer to convert the 3D polygon to a face, then use the PlanarityFilter to get the normal for the surface. The X and Y components of the surface normal can be used in the atan2 arithmetic function to calculate the aspect angle of the surface.
This will be a cartesian angle (CCW, 0 at horizontal), so you may need to convert this to a compass bearing (CW, 0 at vertical).
- Supporter
- 1442 replies
- November 6, 2018
Hi @irene2018,
You can use the FaceReplacer to convert the 3D polygon to a face, then use the PlanarityFilter to get the normal for the surface. The X and Y components of the surface normal can be used in the atan2 arithmetic function to calculate the aspect angle of the surface.
This will be a cartesian angle (CCW, 0 at horizontal), so you may need to convert this to a compass bearing (CW, 0 at vertical).
Hi @DaveAtSafe would you mind elaborating on how to transform the result of the atan2 function from cartesian angle to a compass bearing?
I am currently using the atan2 function in a ExpressionEvaluator transformer as follow:
@atan2(@Value(_surfaceNormalX),@Value(_surfaceNormalY))
This after calculating the surface normals (X and Y) via the PlanarityFilter transformer.
- Safer
- 1633 replies
- November 6, 2018
Hi @DaveAtSafe would you mind elaborating on how to transform the result of the atan2 function from cartesian angle to a compass bearing?
I am currently using the atan2 function in a ExpressionEvaluator transformer as follow:
@atan2(@Value(_surfaceNormalX),@Value(_surfaceNormalY))
This after calculating the surface normals (X and Y) via the PlanarityFilter transformer.
Hi @itay,
To convert from cartesian to a compass bearing (or vice versa), you can use fmod((450 - angle), 360).
However, the result of atan2 is usually radians, so you will need to multiply that by 180/pi first to get degrees.
- Supporter
- 1442 replies
- November 6, 2018
Hi @itay,
To convert from cartesian to a compass bearing (or vice versa), you can use fmod((450 - angle), 360).
However, the result of atan2 is usually radians, so you will need to multiply that by 180/pi first to get degrees.
Thx @DaveAtSafe
- Author
- 19 replies
- November 7, 2018
would you please explain how to use the PlanarityFilter to get the normal for the surface.
- Safer
- 1633 replies
- November 7, 2018
Hi @irene2018,
If you open the properties of the PlanarityFilter, there is a setting at the bottom to calculate the surface normal:
The surface normal will be supplied in three new attributes:
_surfaceNormalX
_surfaceNormalY
_surfaceNormalZ
- Author
- 19 replies
- November 8, 2018
@DaveAtSafe thanks! and if I want to calculate aslo the inclination of each polygon ,What should I do?
- Safer
- 1633 replies
- November 8, 2018
Hi @irene2018,
The inverse cos (acos) of the Z component should give you your inclination off the horizontal.
- Author
- 19 replies
- November 9, 2018
@DaveAtSafe the z component is the _Zsurface normal?
- Safer
- 1633 replies
- November 9, 2018
@DaveAtSafe the z component is the _Zsurface normal?
Hi @irene2018,
Yes.
- Author
- 19 replies
- November 12, 2018
@DaveAtSafe the z component is the _Zsurface normal?
@ Dave At Safe, thanks for your clear answer! . Does this also need to be converted to a compass bearing and then multiply that by 180/pi to get degrees?
- Safer
- 1633 replies
- November 12, 2018
@ Dave At Safe, thanks for your clear answer! . Does this also need to be converted to a compass bearing and then multiply that by 180/pi to get degrees?
Hi @irene2018,
It doesn't need to be converted to a compass bearing, but the result will be in radians, so you do need to multiply it by 108/pi to get degrees.
- Author
- 19 replies
- November 13, 2018
Hi@DaveAtSafe , I have problem with face replacer transformer ,as not all polygons are planar ,I passed by geometry validater transformer that has corrected the problem but the type of polygons has changed to "FME_aggreate" so the face replacer doesn't work ,is there a solution for that?Thanks!
- Safer
- 1633 replies
- November 14, 2018
Hi@DaveAtSafe , I have problem with face replacer transformer ,as not all polygons are planar ,I passed by geometry validater transformer that has corrected the problem but the type of polygons has changed to "FME_aggreate" so the face replacer doesn't work ,is there a solution for that?Thanks!
Hi @irene2018,
Try setting the Thickness Mode on the FaceReplacer to Ignore. This will skip the planarity check. You may also want to set the Angular Mode to ignore as well.
- Author
- 19 replies
- November 15, 2018
Hi @irene2018,
It doesn't need to be converted to a compass bearing, but the result will be in radians, so you do need to multiply it by 108/pi to get degrees.
Thanks @ Dave At Safe ,I was able to calculate but the inclination of flat roof should be between 0 to 15 degrees and I have 80 so i missed something. I calculate the z normal and then do acos (z normal component *57.295
- Safer
- 1633 replies
- November 19, 2018
Thanks @ Dave At Safe ,I was able to calculate but the inclination of flat roof should be between 0 to 15 degrees and I have 80 so i missed something. I calculate the z normal and then do acos (z normal component *57.295
Hi @irene2018,
Please move the '*57.295' outside of the acos() expression.
- Author
- 19 replies
- November 20, 2018
Hi @irene2018,
Please move the '*57.295' outside of the acos() expression.
Hi@ Dave At Safe ,the result is not logic ,the pitched roofs have an inclination of 2.5 degrees while flat roof has 3 degrees ,i can send you the vector file if needed
I have 3D polygons where I need to calculate the aspect for each polygon and add it as attribute. Is there a way to do this? I found a transformer to calculate the aspect for raster but not for vector ,is there a way to go around? Thanks !
Hi @irene2018,
You can use the FaceReplacer to convert the 3D polygon to a face, then use the PlanarityFilter to get the normal for the surface. The X and Y components of the surface normal can be used in the atan2 arithmetic function to calculate the aspect angle of the surface.
This will be a cartesian angle (CCW, 0 at horizontal), so you may need to convert this to a compass bearing (CW, 0 at vertical).
thanks a lot! I will try this
Hi @irene2018,
You can use the FaceReplacer to convert the 3D polygon to a face, then use the PlanarityFilter to get the normal for the surface. The X and Y components of the surface normal can be used in the atan2 arithmetic function to calculate the aspect angle of the surface.
This will be a cartesian angle (CCW, 0 at horizontal), so you may need to convert this to a compass bearing (CW, 0 at vertical).
Hi @DaveAtSafe would you mind elaborating on how to transform the result of the atan2 function from cartesian angle to a compass bearing?
I am currently using the atan2 function in a ExpressionEvaluator transformer as follow:
@atan2(@Value(_surfaceNormalX),@Value(_surfaceNormalY))
This after calculating the surface normals (X and Y) via the PlanarityFilter transformer.
Hi @DaveAtSafe would you mind elaborating on how to transform the result of the atan2 function from cartesian angle to a compass bearing?
I am currently using the atan2 function in a ExpressionEvaluator transformer as follow:
@atan2(@Value(_surfaceNormalX),@Value(_surfaceNormalY))
This after calculating the surface normals (X and Y) via the PlanarityFilter transformer.
Hi @itay,
To convert from cartesian to a compass bearing (or vice versa), you can use fmod((450 - angle), 360).
However, the result of atan2 is usually radians, so you will need to multiply that by 180/pi first to get degrees.
Hi @itay,
To convert from cartesian to a compass bearing (or vice versa), you can use fmod((450 - angle), 360).
However, the result of atan2 is usually radians, so you will need to multiply that by 180/pi first to get degrees.
Thx @DaveAtSafe
would you please explain how to use the PlanarityFilter to get the normal for the surface.
Hi @irene2018,
If you open the properties of the PlanarityFilter, there is a setting at the bottom to calculate the surface normal:
The surface normal will be supplied in three new attributes:
_surfaceNormalX
_surfaceNormalY
_surfaceNormalZ
@DaveAtSafe thanks! and if I want to calculate aslo the inclination of each polygon ,What should I do?
Hi @irene2018,
The inverse cos (acos) of the Z component should give you your inclination off the horizontal.
@DaveAtSafe the z component is the _Zsurface normal?
@DaveAtSafe the z component is the _Zsurface normal?
Hi @irene2018,
Yes.
@DaveAtSafe the z component is the _Zsurface normal?
@ Dave At Safe, thanks for your clear answer! . Does this also need to be converted to a compass bearing and then multiply that by 180/pi to get degrees?
@ Dave At Safe, thanks for your clear answer! . Does this also need to be converted to a compass bearing and then multiply that by 180/pi to get degrees?
Hi @irene2018,
It doesn't need to be converted to a compass bearing, but the result will be in radians, so you do need to multiply it by 108/pi to get degrees.
Hi@DaveAtSafe , I have problem with face replacer transformer ,as not all polygons are planar ,I passed by geometry validater transformer that has corrected the problem but the type of polygons has changed to "FME_aggreate" so the face replacer doesn't work ,is there a solution for that?Thanks!
Hi@DaveAtSafe , I have problem with face replacer transformer ,as not all polygons are planar ,I passed by geometry validater transformer that has corrected the problem but the type of polygons has changed to "FME_aggreate" so the face replacer doesn't work ,is there a solution for that?Thanks!
Hi @irene2018,
Try setting the Thickness Mode on the FaceReplacer to Ignore. This will skip the planarity check. You may also want to set the Angular Mode to ignore as well.
Hi @irene2018,
It doesn't need to be converted to a compass bearing, but the result will be in radians, so you do need to multiply it by 108/pi to get degrees.
Thanks @ Dave At Safe ,I was able to calculate but the inclination of flat roof should be between 0 to 15 degrees and I have 80 so i missed something. I calculate the z normal and then do acos (z normal component *57.295
Thanks @ Dave At Safe ,I was able to calculate but the inclination of flat roof should be between 0 to 15 degrees and I have 80 so i missed something. I calculate the z normal and then do acos (z normal component *57.295
Hi @irene2018,
Please move the '*57.295' outside of the acos() expression.
Hi @irene2018,
Please move the '*57.295' outside of the acos() expression.
Hi@ Dave At Safe ,the result is not logic ,the pitched roofs have an inclination of 2.5 degrees while flat roof has 3 degrees ,i can send you the vector file if needed
Related Topics
FME Server submitting job in local networkicon
AuthoringFME Server 2020: Unable to run workspaces manuallyicon
DataIs the FME translation log window limited to 1000000 lines? Also, are there limitations to the size of the physical log file (the translation stalled at 532944 kb)icon
TransformersUnable to run Jobsicon
ArchitectureFMEServerJobSubmitter job with HTTPCaller can't connect to serviceicon
Authoring
Helpful Members This Week
- takashi
25 votes
- nielsgerrits
12 votes
- hkingsbury
11 votes
- jdh
8 votes
- ebygomm
7 votes
- redgeographics
7 votes
- virtualcitymatt
7 votes
- panda
6 votes
- desiree_at_safe
5 votes
- david_r
5 votes
Recently Solved Questions
OneDrive single tenant web connection is approved but will not authenticate
1 ReplyGeocoder with ArcGIS Online
2 RepliesAvoiding overlaps and gaps when buffering line segments to polygons
2 RepliesGIS FC (FGDB) to Excel Spreadsheet
1 Reply'Feature Types to Read' not listing all selected input files
2 Replies
Community Stats
- 31,840
- Posts
- 120,938
- Replies
- 39,474
- Members
Latest FME
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Scanning file for viruses.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
OKThis file cannot be downloaded
Sorry, our virus scanner detected that this file isn't safe to download.
OKCookie 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
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.