Skip to main content

I am using an aggregated object to insert a cell using the dgnstyler. The aggregated object has 2 geometries, a point and a line. I need to use the line as a reference for the angle of the cell rotation, but I do not know how to derive an angle for this line. Can someone help me find a way to do this?

The AzimuthCalculator will get you Angle and Azimuth of a line. This transformer can be downloaded from the FME store.


This one was too interesting. I had to bite. I must ask, where is that original geometry coming from? Smallworld perchance?

In any case, given that you're starting with an aggregate and you want to end with a point and a rotation, it raises an interesting problem. How do you split things up, keeping what you need handy, without resorting to some kind of evil FeatureMerger, which will block things up, downstream.

I realized that you can tuck away the original geometry conveniently with a GeometryExtractor, and then Deaggregate followed by a GeometryFilter to keep only the piece you need. Then extract what you need from it, and then you can put back the whole original geometry with a GeometryReplacer, and then repeat but the second time keep the other piece. Works great. No blocking. Just some features being Deaggregated and destroyed 'cause they're unwanted a couple of times.

Never had done this trick before. Worked great. Plus it was a great test of the FME 2016 release candidate we're fussing about these days.

Screen shot below, FME 2016 workspace attached - pointlinerotationcalculator.fmw

The technique should work with FME 2015 as well, but some of the transformers may be a bit differently named so you'd need to recreate those parts if you tried to open this workspace with an older FME. (Generally not recommended).

Good luck.


This one was too interesting. I had to bite. I must ask, where is that original geometry coming from? Smallworld perchance?

In any case, given that you're starting with an aggregate and you want to end with a point and a rotation, it raises an interesting problem. How do you split things up, keeping what you need handy, without resorting to some kind of evil FeatureMerger, which will block things up, downstream.

I realized that you can tuck away the original geometry conveniently with a GeometryExtractor, and then Deaggregate followed by a GeometryFilter to keep only the piece you need. Then extract what you need from it, and then you can put back the whole original geometry with a GeometryReplacer, and then repeat but the second time keep the other piece. Works great. No blocking. Just some features being Deaggregated and destroyed 'cause they're unwanted a couple of times.

Never had done this trick before. Worked great. Plus it was a great test of the FME 2016 release candidate we're fussing about these days.

Screen shot below, FME 2016 workspace attached - pointlinerotationcalculator.fmw

The technique should work with FME 2015 as well, but some of the transformers may be a bit differently named so you'd need to recreate those parts if you tried to open this workspace with an older FME. (Generally not recommended).

Good luck.

Click on the .png link above (or here) to see the workspace more clearly.


Wow I never was notified that this was replied to lol. I have learned quite a bit since then. Thanks @daleatsafe. Yes it was from smallworld. What I do now is I run a deaagregator followed by a geometryfilter. I run the line through a length calculator and into a featuremerger to bring that length attribute into the point. Then I run it through an reprojectanglecalculator to get the proper reprojected angle for my cell rotation. Easy-Peasy! :)


Wow I never was notified that this was replied to lol. I have learned quite a bit since then. Thanks @daleatsafe. Yes it was from smallworld. What I do now is I run a deaagregator followed by a geometryfilter. I run the line through a length calculator and into a featuremerger to bring that length attribute into the point. Then I run it through an reprojectanglecalculator to get the proper reprojected angle for my cell rotation. Easy-Peasy! :)

Hey, thanks for responding. I like the sound of your solution too.If the data volumes are modest bringing the parts together via a FeatureMerger is a completely good idea. Well done!

 

 


Reply