Skip to main content
Solved

How to compare column names(tables) for two shp to see if a column has been added or removed?


john_esk
Contributor
Forum|alt.badge.img+6

Hey!

I have created a workspace that downloads a zip file containing a shp everytime the data has been updated. I now want to compare the shp in the zip file with the older shp on a ArcSDE database to see if a column has been added or removed. I have tried using a FeatureReader to read the shp in the zip but I don't know how to do the comparising step. The goal is to get notified via the Emailer when the tables has been changed(not indivudal values). What is the best method?

Best answer by takashi

Hi @john_eskilstuna, you can read schema features from a dataset with the Schema (Any Format) reader or the FeatureReader.

FeatureReader parameters

A schema feature has an attribute called "fme_feature_type_name" which stores name of the feature type (table), and a list attribute called "attribute{}" which stores attribute names and data types defined.
  • fme_feature_type_name: feature type name
  • attribute{}.name: attribute name
  • attribute{}.fme_data_type: FME generic data type name
  • attribute{}.native_data_type: data type name specific to the data format
See also here to learn about Schema Feature:Dynamic Workflows: Destination Schema is Derived from a Schema FeatureRead schema features from the datasets that you want to compare schemas, explode the "attribute" list with the ListExploder. You can then compare the schema between the datasets.

 

Example:

View original
Did this help you find an answer to your question?

3 replies

pratap
Contributor
Forum|alt.badge.img+11
  • Contributor
  • June 29, 2018

Hi,

Have you tried change detector?

Pratap


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • June 29, 2018

Hi @john_eskilstuna, you can read schema features from a dataset with the Schema (Any Format) reader or the FeatureReader.

FeatureReader parameters

A schema feature has an attribute called "fme_feature_type_name" which stores name of the feature type (table), and a list attribute called "attribute{}" which stores attribute names and data types defined.
  • fme_feature_type_name: feature type name
  • attribute{}.name: attribute name
  • attribute{}.fme_data_type: FME generic data type name
  • attribute{}.native_data_type: data type name specific to the data format
See also here to learn about Schema Feature:Dynamic Workflows: Destination Schema is Derived from a Schema FeatureRead schema features from the datasets that you want to compare schemas, explode the "attribute" list with the ListExploder. You can then compare the schema between the datasets.

 

Example:


john_esk
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 3, 2018
takashi wrote:

Hi @john_eskilstuna, you can read schema features from a dataset with the Schema (Any Format) reader or the FeatureReader.

FeatureReader parameters

A schema feature has an attribute called "fme_feature_type_name" which stores name of the feature type (table), and a list attribute called "attribute{}" which stores attribute names and data types defined.
  • fme_feature_type_name: feature type name
  • attribute{}.name: attribute name
  • attribute{}.fme_data_type: FME generic data type name
  • attribute{}.native_data_type: data type name specific to the data format
See also here to learn about Schema Feature:Dynamic Workflows: Destination Schema is Derived from a Schema FeatureRead schema features from the datasets that you want to compare schemas, explode the "attribute" list with the ListExploder. You can then compare the schema between the datasets.

 

Example:

Thank you once again @takashi !

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings