Skip to main content

Hi,

I am trying to calculate the percentage change in area between two sets of postal code polygons.

So I have an old polygon file and a newer one, and I connect them to an AreaCalculator to get the area of the polygons. Now, for the calculation of %change I would use the ExpressionEvaluator but I cannot figure out how to keep the output tied to its original row. It either puts out way too many values as its own thing or treats it as one big calculation.

I just can't really figure out how to set this up. It should be as simple as X divided by Y but it does not seem to want to cooperate on the output.

 

This
is what I have so far. It creates the _area_F0 and E0 as I want, but
when I try to do the division in the expressionevaluator it either fails
saying it's dividing by 0 if I use the "/" operator in an equation or
if I use the "div" function it runs but created a row for each
individual row in both readers so it ends up with 75k entries where the
result value is null. it should end with 38217 rows where 37280 should
have the result and the rest are null because there's no matching value.

Any advice on this would be greatly appreciated. Thank you.

Set up the AreaCalculators to create attributes Area1 and Area2 (or similar).

If both polygon datasets have a common ID (or any other common attribute) for the polygon you need to merge both sets using the FeatureMerger.

After merging you can use the ExpressionEvaluator to do the calculation.


From the image I can see that the features are arriving individually to the expressionevaliator.

You need to merge the old and new features (common id or spatial relationship) so that both the old area and new area values are present on the merged feature.

Hope this helps.


Set up the AreaCalculators to create attributes Area1 and Area2 (or similar).

If both polygon datasets have a common ID (or any other common attribute) for the polygon you need to merge both sets using the FeatureMerger.

After merging you can use the ExpressionEvaluator to do the calculation.

 

This is what I currently have. (Ignore the extra stuff in top)

 

 

It creates the _area_F0 and E0 like I want but then when I try to do the division in the expressionevaluator it either says it's dividing by 0 and fails if I create it using the "/" operator or if I use the div function it will run but it creates a row for each in both readers so I end up with a bunch of duplicates and the result field is null.

 


 

This is what I currently have. (Ignore the extra stuff in top)

 

 

It creates the _area_F0 and E0 like I want but then when I try to do the division in the expressionevaluator it either says it's dividing by 0 and fails if I create it using the "/" operator or if I use the div function it will run but it creates a row for each in both readers so I end up with a bunch of duplicates and the result field is null.

 

The old and new features are entering the transformer separately and therefore you cannot do the calculation,

 

try to merge the area values (featuremerger) before the expressionevaliator

From the image I can see that the features are arriving individually to the expressionevaliator.

You need to merge the old and new features (common id or spatial relationship) so that both the old area and new area values are present on the merged feature.

Hope this helps.

Thanks for your advice I think it got me a lot of the way. I think I'm doing something wrong now though as many polygons that have change are throwing a 1 (no change) and ones that seemingly have no change have a positive or negative value.

 

 

Am I correct in using the FeatureMerger for this?

 

 

 


Thanks for your advice I think it got me a lot of the way. I think I'm doing something wrong now though as many polygons that have change are throwing a 1 (no change) and ones that seemingly have no change have a positive or negative value.

 

 

Am I correct in using the FeatureMerger for this?

 

 

 

Yes, and from what I can see most of the requestors find a supplier and the calculation can take place (tip for future reference add a summery annotation to the merger to show how the merge is taking place) all not merged (requestors without a supplier) are features where a calculation is not possible.

 

hope this helps.

Reply