Question

How to relate to attribute filters?


  • PL.shp with attribute 1
  • Excel with Attibute 1 and Attribute 2
  • Attribute 1s relate

I have AttributeFilter set for Attribute 1 to extract Attirbute 1 from PL.shp

 

I need to relate Attribute 1 to Attribute 2, which was not in PL.shp, but is in a related Excel

 

Once the relate is attained from 1 and 2, I need to create a shp that retains the name of Attribute 2 which is then written into a folder with Attribute 2 name.

 

This will have to be done 200 times, so how can I efficiently get from reader to writing 200 shps that need to be in attribute 2 named folders?

 

Then from there, the shp needs to be created into an excel that is placed in attribute 2 named folder.


4 replies

Userlevel 5
Badge +25

There's a number of transformers that can be used to merge the Excel file with the Shapefile based on an attribute. You could use a DatabaseJoiner for example. Alternatives are the FeatureMerger or FeatureJoiner but for those you'd have to read the Excel file into the workspace first.

 

They all have in common that they can merge based on one or more attributes and will transfer the attributes from one side to the other. That should give you Attribute2 on the features coming out of the Shapefile.

 

Writing out dynamically can be done through the Fanout option on the writer (in the Navigator), where you can set parts of the file path/name to be taken from attribute values.

Badge +2

@bwc​ more on joining data in a webinar we ran Data Integration Basics: Merging & Joining Data

There's a number of transformers that can be used to merge the Excel file with the Shapefile based on an attribute. You could use a DatabaseJoiner for example. Alternatives are the FeatureMerger or FeatureJoiner but for those you'd have to read the Excel file into the workspace first.

 

They all have in common that they can merge based on one or more attributes and will transfer the attributes from one side to the other. That should give you Attribute2 on the features coming out of the Shapefile.

 

Writing out dynamically can be done through the Fanout option on the writer (in the Navigator), where you can set parts of the file path/name to be taken from attribute values.

@Hans van der Maarel​ thanks for sharing the merge information. I choose to use FeatureMerger and was successful at creating 200 shps from the data and excel merge and relate.

I have one last question, although I can create individual shps and excels (AA_@Value(AT2) following, is there any way to direct the writer to write each shp to the 200 individual folders which names are based on Attribute 2?

Badge +2

@Hans van der Maarel​ thanks for sharing the merge information. I choose to use FeatureMerger and was successful at creating 200 shps from the data and excel merge and relate.

I have one last question, although I can create individual shps and excels (AA_@Value(AT2) following, is there any way to direct the writer to write each shp to the 200 individual folders which names are based on Attribute 2?

You can use the dataset fanout - similar to what you are doing on the feature type with (AA_@Value(AT2) , but at the writer level on in the workbench navigator (or writer parameters if you're using FeatureWriter)

Reply