Question

Transformer parameter

  • 22 January 2013
  • 4 replies
  • 8 views

Badge +5
I'm trying to assign a Destination Coordinate System parameter of an AttributeReprojector the value of  a Coordinate system based on a filtered condition of the features that will pass through this transformer.

 

 

The filtered condition is the output of this point feature dataset is created from two reprojector transformers based on their location. Their location was determined by the use of a spatialfilter with two features representing SP East and SP West of the state of Georgia. This set of points intersect the boundary of SP East and SP West. The business rule is whichever State plane zone polygon has more points contained, the attributereprojector will use that zone as the destination coordinate system.

 

 

I'm facing a wall right now.

 

 

I'm trying to find a way how to compare the count from each reprojector using counters. Is there a way I can assign the results of these two counters into a variable and then based on a decision, merge these two outputs into the input of the Atrributereprojector and then use that variable as a destination coordinate system parameter?

4 replies

Badge +14
I'm not sure that you can select a required coordsys from an Attribute with the AttributeReprojector... only Parameters. Is it practical to run your process with two workspaces? If so in workspace 1 do what you need to do and then write your data partially processed using a Recorder to an FFS file, leave the output of the Recorder unconnected or just use a Sampler to get 1 trigger feature out of the back of the Recorder (pass through features)... then put whatever coordsys values you need into attributes and send that feature into a WorkspaceRunner. Workspace 2 will need to have a Parameter setup to recieve the required coordsys attribute along with an FFS Reader to go and get the data. The AttributeReprojector can then be configured to pick up the target coordsys from the input Parameter passed in from Workspace 1.

 

 

It means having two workspaces but if it's a regular process it should be worth it.
Userlevel 2
Badge +17
Alternatively, a series of transformers - Counters, VariableSetters, FeatureHolder and VairableRetrievers - might also help you. After dividing the flow of the point features into two streams (call A and B here) based on the geographic condition, count features and assign the count attribute to variables on each stream. Assume variable names are varNumPointsA and varNumPointsB, for example. Next, join the streams into a FeatureHolder. After holding all features, the value of varNumPointA / B will be the number of features (i.e. the last count attribute value) coming from A / B. After this, retrieve the variables and set those values to attributes - e.g. numPointsA and numPointsB - of each feature. Then you can test whether numPointsA is greater than numPointsB or not.
Userlevel 2
Badge +17
In addition, you can save the source coordinate systems of A and B as variables before FeatureHolder, and select one of them as the destination coordinate system based on the result of testing whether numPointsA is greater than numPointsB.
Badge +14
A couple of updates, firstly as of FME 2013 you now CAN choose a source or destination coordsys from an attribute input to the Reprojector transformer and some of the other reprojectors too.

 

 

Also, as a point of reference when reprojecting, Safe now seem to be suggesting that the CSMapReprojector should now be considered as the default reprojection transformer. A excerpt from a recent correspondence with Safe is as follows:

 

 

Starting in FME 2013 we recommend using the CSMAPReprojector for all coordinate system transformations  More information can be found here: http://fmepedia.safe.com/articles/FAQ/CS-Map-upgrade-in-FME-2013

Reply