Skip to main content

Hi there,

 

I'm running into an issue where an attribute that was initially numeric ('counts') is being converted to a character type after I sum 'counts' for each 'tree_type' per 'area_unit' using AttributePivoter (example left to right in image below).

 

Tree CountsNote: These attributes/data are just an example.

 

This is a problem as I'm trying to write the results as a shapefile, which won't work properly for analysis in ArcGIS Pro as it recognises these fields as text rather than integer.

 

Here are more details about my process for summing counts of tree types by area unit.

 

Input = CSV and 'counts' is read in as UInt32.

1.) I used an AttributeExploder with exploding type set to List, Keep Attributes = Yes, and Keep Geometry = No (Geometry is added later).

2.) AttributePivoter, Group Rows By: = 'area_unit', Group Columns By: = 'tree_type', Attributes To Analyze: = 'counts', Pivot Summary Statistic Types: = Sum, Row Group Summary Line Descriptor: = Total, Include Grand Total Columns: = Yes,

3.) AttributeExposer where attributes to expose is each tree type.

 

Not too sure why the new attributes created based off the counts are coming out as varchar when the 'counts' column goes into the transformer as numeric. Is there anything I'm doing wrong which is causing this? Or, is there a way to convert these attributes back into a numeric type in the workbench?

 

Thanks.

If the input is as per your image on the left, what is the AttributeExploder for?

I don't generally use AttributePivoter to pivot data, but counts remain numeric for me.


FME doesn't really care about data types.

They are only important when writing. So, configure your writer accordingly.


@scottt​ or... pass your data through the SchemaScanner and use a dynamic writer on your Shape File. A bit more on SchemaScanner here. And the video (starts around minute 3)


FME doesn't really care about data types.

They are only important when writing. So, configure your writer accordingly.

Hi,

 

I tried manually setting the writer to numeric data types but it doesn't work


FME doesn't really care about data types.

They are only important when writing. So, configure your writer accordingly.

After doing more testing I believe the issue is an ArcGIS Pro issue rather than an FME issue in terms of reading that data properly. Thanks for the help


After doing more testing I believe the issue is an ArcGIS Pro issue rather than an FME issue in terms of reading that data properly. Thanks for the help

ArcGIS Pro has a very unholy way of handling Excel files. Both when writing and reading.

Try exporting a dataset with a lot of attributes/columns (25+) from Arc Pro and see header stacking in all it's splendor 😁

Glad you found the problem.


Reply