Question

Can you control attribute filter using an excel list of attributes

  • 3 January 2020
  • 5 replies
  • 8 views

Badge

I have a csv file with 55 attributes for each feature, I'd like to join only relevant attributes to various shapefiles (using FeatureJoiner). For example my Farm shapefile may need only 10 of those 55 attributes, my Buildings shapefile could require 20 attributes from the csv. For each shapefile I have an excel list of required attributes. How can I read in the main csv and filter it based on the xls - so only the attributes on the xls are passed to the FeatureJoiner?

Have tried Attribute Filter, importing the xls but I can't see how to filter on this?

Any suggestions?

Thanks

Chris

 


5 replies

Userlevel 2
Badge +12

Would it also be an option to join all attributes and define the writer to use only the attributes that you need?

This is much easier to accomplish.

Badge

Hi erik_jan

Thanks for responding. Yes I can do that but I still have to manually select the required attributes within the writer. I'm trying to find something that can do that from the xls.

Userlevel 2
Badge +12

The SchemaMapper transformer has options to filter attributes based on a spreadsheet.

Badge +2

@cbrown You can use the schema feature that is created by the FeatureReader. Modify the list of attributes and then use the EsriShape writer in dynamic mode to create the shape files with the correct attributes. Something like:

I've attached the example workspace (2019.1): dynamicschema.fmwt

Userlevel 2
Badge +17

Since you already have the Excel table that defines attribute sets for each destination Shapefile datasets, I think you can enhance the table to use it as a lookup table to configure destination schema at run-time.

See here to learn more: Destination Schema is Derived from a Lookup Table

Reply