Skip to main content

  I am using FME to write all the MapInfo TAB files in a directory and it's subdirectories to a File Geodatabase. I'm using dynamic readers and dynamic writers as I don't know the geometry or schema of the input files beforehand. So far so good. Now, suppose that I have a file called 

"Pipeline.TAB"
 at the root of the directory and I have another file called 
"Pipeline.TAB"
 in a subdirectory. No problem. FME can merge the two files together and I get the geometry from both files in my new feature class called 
"Pipline_line"

  My issue is, suppose those two original files have different attributes. Say, the file in the root folder has a field called "Name" and the second file has a field called 

"Pipe_Name"
. My resulting feature class gets the 
"Name"
 field but not the 
"Pipe_Name"
 field. The features that came from the file in the subdirectory have a NULL value in the 
"Name"
 field. Instead, what I would like is to have both fields come through. I'm happy if the 
"Name"
 field is NULL as long as the 
"Pipe_Name"
 field is there and has the correct values. 

  It appears that the schema is determined by the first feature that is being read, whereas, I need it to use the schema from all of the features with the same name.  Is this possible?

Hi,

 

 

I think renaming attributes of features coming from the second dataset would be a quick way. FME Workbench provides these transformers to rename feature attributes. - AttributeRenamer - SchemaMapper (Map Attributes scenario) - BulkAttributeRenamer See those help documentations, and choose suitable one to the actual condition. If no one could be applicable in your condition, let us know the requirement.

 

 

Takashi

Takashi,

 

 

I've looked at those, but I don't think that will solve my problem.  The example I gave was simple in that it only had two files called Pipeline.TAB.  In reality, I'm looking at dozens of folders with thousands of files.  there might be 20 files called "Pipeline" and another twenty called "Valves", etc.  I won't know the schema of all of them at the start.

 

 

What I would like the final attribute table of my destination feature class to look like would be something like this:

 

 

Name            | Pipe_Name

 

Pipe1            | NULL

 

Pipe2            | NULL

 

Pipe3            | NULL

 

NULL            | Pipe 4

 

NULL            | Pipe 5

 

 

In the final file, there may actually be many fields.  But I won't know all of them  at the start:

 

 

Name           | Pipe_Name | Diameter | Material | Type

 

Pipe1            | NULL            | 500            | Steel       | Gas

 

Pipe2            | NULL            | 1200          | Steel       | Gas

 

Pipe3            | NULL            | 800            | PVC         | Water

 

NULL            | Pipe 4           | NULL        |NULL        | Water

 

NULL            | Pipe 5           | NULL        |NULL        | Water

 

 

Hope that clears things up.
I see. You are trying to merge schemas of all source datasets dynamically. I have no experience on that, but creating a Custom Format which can be used as a Workspace Resource perhaps would be one of solutions. See these threads. > Dynamic schema partial merge from 2 data sources > Sharing: "Extracting a schema subset for dynamic schemas"   Although those threads are discussing how to extract schema subset, I think the basic mechanism can be applied to your goal. My idea about the custom format to create merged schema is: Schema Reader (read schemas of all specified source datasets) --> ListExploder (explode attribute{} list) --> DuplicateRemover (remove duplicate attribute names) --> AttributeAccumulator (re-build "attribute{}" list) --> AttributeCreator(define "fme_feature_type_name") --> Write Schema after removing unnecessary attributes   It's just an idea, I cannot guarantee it works...

Reply