Skip to main content
Question

Using StatisticsCalculator output

  • January 22, 2014
  • 5 replies
  • 163 views

Hi,

 

I am trying to use two results from a statistics calculator (total population from a excel sheet and total area from a shapefile), in order to estimate population density.

 

 

The trouble I have is how do I use these constants (total population & total area) in the expression calculator, in order to calculate an estimate population, i.e.

 

(total pop / total area)*area (where area is the area of each polygon)

 

 

Thanks,

 

Ed

 

 

 

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.

5 replies

david_r
Celebrity
  • January 22, 2014
Hi,

 

 

in the ExpressionEvaluator dialog box, simply double click on the "FME feature attributes" list items to insert them into your expression.

 

 

 

 

See the help text for more details.

 

 

David

  • Author
  • January 22, 2014
Thanks David,

 

Sorry I probably wasn't very clear, the Total Population and Total Area are independant from the shapefile containing the areas.

 

 

So I want to use the outputs from the statistics calculator (Total pop and total area) as constant values in another shapefile (which doesn't have the attributes total pop and total area).

 

 

I have tried using AttributeCreator to make a new attribute with a constant value (total population) but is there a way to do this without inputting it manually.....or ideally without having to add total population and total area as a new attribute.

 

 

Sorry I hope that makes sense

david_r
Celebrity
  • January 22, 2014
Hi,

 

 

ok, I understand (I think). You can use the UnconditionalFeatureMerger (from the FME Store) to join the results from the StatisticsCalculator with each feature containing the polygons.

 

 

David

takashi
Celebrity
  • January 22, 2014
Hi,

 

 

If you are using FME 2013 SP2+, existing FeatureMerger can be also used to perform unconditional merging. Just specify same constant (e.g. "1") to "Join On" parameter for both Requestor and Supplier.

 

For your information.

 

 

Takashi

  • Author
  • January 22, 2014
Thanks very much David and Takashi, that is exactly what I was after!

 

Much appreciated