Skip to main content

Using ESRI's Data Interoperability Extention (FME 2012 SP1), I've built a tool which creates an excel file that summarizes water utility information in each of our service areas. As you can see in the screenshot below, the tool gives me length of water lines based on each combination of diameter & material in each service area. Also, the first row for each service area lists the square footage of polygon features in each service area and the quantity of point features in each service area.

 

 

 

The issue I'm running into now is with the polygon features (Casing & ThrustProtection in this case) having blank cell values in the first row of each service area. I believe the reason their cell values are blank is because we don't have any of those polygon features in these particular service areas in our data. Ideally though, these cell values would be zero instead of blank. So in the screenshot above, cells H2, I2, & I15 would be zero instead of blank. All the rest of the blank cells would remain blank.

 

 

Currently, I'm using the SpatialRelator with service area as Base & the various other features as Candidates. For the polygon features, after the spatial relator, I use ListExploder and then StatisticsCalculator. The StatisticsCalculator analyzes the area attribute in the polygon features that make it through the SpatialRelator. I've tried inserting NullAttributeReplacer at various spots in the workflow, but nothing seems to get the blank cell values for the polygon features converted to a zero.

 

 

Any ideas on how I can get these blank cells converted to zeros? I'd call myself a novice to intermediate level user so any extra details are greatly appreciated.

Thanks!

 

 
Hi

 

 

have a look at the NullAttributeMapper.

 

 

David
Try with these settings:

 

 

 

 

David

Thanks David,

 

 

Unfortunately, it doesn't appear that NullAttributeMapper is available in the version I'm using (FME 2012 SP1 in  ESRI's Data Interoperability Extension).
You canuse a tester for that.

 

IN fme2012 what is now is called "missing" was called..erhm.."unknown" I kinda forgot..long time ago.

 

test for empty or "unknown" or whatever it used to be called in the days. Then a attribute creator to set it to 0.
Hi,

 

 

I think the NullAttributeReplacer in FME 2012 works to assign 0 to the blank attributes. How did you apply the transformer in your workspace?

 

 

The NullAttributeMapper in FME 2014+ is the upgraded version of the NullAttributeReplacer. The Mapper has inherited the functionality of the Replacer. i.e. assign a specific value to "blank" attributes. The fundamental difference between them is that the Repalcer cannot distinguish <empty> <null> <missing> attributes, but the Mapper can do that.

 

 

Takashi

Hi Takashi,

 

 

Each feature I'm attempting to summarize goes through the following transformer sequence:

 

 

SpatialRelator/ListExploder/StatisticsCalculator

 

 

I've attempted to insert the NullAttributeReplacer at various places in the workspace including after the SpatialRelator, after the ListExploder, and after the StatisticsCalculator. I get the same results each time (see screenshot in my original post). 

 

 

Next, the results from each feature's StatisticsCalculator are combined and go through an AttributeAccumulator/Sorter/StringReplacer sequence before entering the writer. I've noticed that when I insert the NullAttributeReplacer after the AttributeAccumulator, all the empty cells in columns G, H, & I get assigned a zero (see below). This isn't desireable either.

 

 

 

Logically, the Tester & AttributeCreator that Gio recommended makes sense. However, for some reason that creates empty cells in all other values in columns G-K and I lose all the correct data. I'll keep working this combination to see if I can get the desired results.

 

 

Thanks to you both for your help!
I think the Tester + NullAttributeReplacer combination brings the desired result.

 

For example:

 


I was able to get the desired results in my excel file by using Takashi's details above on the Tester/NullAttributeReplacer sequence w/one small alteration. For some reason, when I used @Value(WaterLineType) in the left value of the Tester, nothing changed. However, when I changed the left value in the Tester to just the attribute name, WaterLineType, it worked as desired.

 

 

Also of note for anyone else using the Tester/NullAttributeReplacer sequence...I found that I needed to map all the attributes in both the Failed port of the Tester and the Output port of the NullAttributeReplacer to the Excel writer in order for all the other attributes to populate correctly in the excel file. Originally, I did not map the attributes from the Output port of the NullAttributeReplacer and it overwrote all the other correct attribute values with blanks.

Thank you again to Gio for the original idea and to Takashi for the added detail to get me moving in the right direction.


Reply