Hello,
I have an input dataset, that has numerous fields which are Null, and only a handful of fields that are useful. I want to completely remove the attribute fields that are Null, only leaving the useful data. Input is a geo-package, and output is a file geodatabase. I have actually achieved the goal to 90% but have hit a snag, which this post is about.
The geopackage has numerous layer I am doing this for, but for this post I will focus on the OBSTRN layer.
My current work flow is:
Reader (OBSTRN) > NullAttributeMapper (Sets Nulls to Missing) > SchemaScanner (Removes Empty Attributes) > Dynamic Writer
The dynamic writer settings:
Feature Class/Table Name: fme_feature_type
Geometry: From Schema Definition
Schema Source: “Schema from Schema Feature”
Schema Def Name: fme_feature_type_name
- As mentioned , this output gets me to what I want about 90-95%. The problem is. Within the OBSTRN object class, there exists Points, Lines, and Polygons. I have noticed in other objects that have a single geometry, and attribute values are all null, the attribute field is removed, which is great. But, when multiple geometries exist, all attribute values for a particular field must be null across all geometries within the object class in order for it to be removed. So if OBSTRN.L has an attribute value, but in OBSTRN.A the values are all null, because OBSTRN.L is populated, the field remains in OBSTRN.A. See output examples below.
-
In the above example, the CONDTN field should not be in the output, because all the values are <Null>. However I think this is because other CONDTN attributes within the OBSTRN object class (OBSTRN.polygon) do have values other than <Null>. See below
So I really would like the attribute field to get dropped when all <Null> based on geometries for the object class, instead of the object class as a whole.
I have tried to place Geometry Filter before the NullAttributeMapper, in between NullAttributeMapper and Schema Scanner, and after SchemaScanner, but continuously get warnings with no output.
Here are the warnings I am getting, pretty much warnings for all attributes it seems. It creates the GDB, but no feature classes.
Appreciate any help, please let me know if you need more information.
Thanks