Question

TestFilter - can you use the output port as table name in PostGIS / FILEGDB writer


I have setup a test filter that separates out a number of shapefiles based on part of the filename. I now want to use the output port that these features will run through as the new table name. Is there an easy way to do this, or do I need to create a writer for each port so that this has the correct table name.


9 replies

Userlevel 2
Badge +12

You can use attribute values as the name of the output file.

Instead of using the TestFilter I would have used an AttributeCreator (use the conditional values option) to create different values for the new attribute (e.g. FileName).

Then use that attribute to define the Shape file name in the Writer feature type.

Badge +10

Do you actually need to use a test filter? You could conditionally assign an attribute using the same statements and then fanout on this attribute to create separate shape files

Badge +10

You can use attribute values as the name of the output file.

Instead of using the TestFilter I would have used an AttributeCreator (use the conditional values option) to create different values for the new attribute (e.g. FileName).

Then use that attribute to define the Shape file name in the Writer feature type.

Snap!

 

 

Userlevel 2
Badge +12

You can use attribute values as the name of the output file.

Instead of using the TestFilter I would have used an AttributeCreator (use the conditional values option) to create different values for the new attribute (e.g. FileName).

Then use that attribute to define the Shape file name in the Writer feature type.

And an image to explain:

 

 

Thanks for the prompt replies. I have shapefiles that are named like this:

 

SU_AdministrativeBoundary

 

ST_AdministrativeBoundary

 

etc etc. then there are also other types that are defined this way such as Buildings, Roads etc.

 

I was hoping to consolidate these so that all AdministrativeBoundary files could go into a new table or featureclass (file geodatabase) using this generic name, rather then new tables for each different name.

 

 

 

 

Userlevel 2
Badge +12
Thanks for the prompt replies. I have shapefiles that are named like this:

 

SU_AdministrativeBoundary

 

ST_AdministrativeBoundary

 

etc etc. then there are also other types that are defined this way such as Buildings, Roads etc.

 

I was hoping to consolidate these so that all AdministrativeBoundary files could go into a new table or featureclass (file geodatabase) using this generic name, rather then new tables for each different name.

 

 

 

 

So the AttributeCreator would be like this:

 

Attribute Name: TableName

 

Attribute Value: If fme_basename contains "AdministrativeBoundary" Then "AdministrativeBoundary", Else If fme_basename contains "Building" Then "Building" and so on.

 

That would create one attribute containing "AdministrativeBoundary" in both examples.

 

 

So the AttributeCreator would be like this:

 

Attribute Name: TableName

 

Attribute Value: If fme_basename contains "AdministrativeBoundary" Then "AdministrativeBoundary", Else If fme_basename contains "Building" Then "Building" and so on.

 

That would create one attribute containing "AdministrativeBoundary" in both examples.

 

 

Sorry, I think I am missing something. I cannot do this with my AttributeCreator. I only have two options New Attribute and Attribute Value. How do I enable the conditional values option?

 

 

Userlevel 2
Badge +12
Sorry, I think I am missing something. I cannot do this with my AttributeCreator. I only have two options New Attribute and Attribute Value. How do I enable the conditional values option?

 

 

Click the Value and use the down arrow:

 

 

Sorry, I think I am missing something. I cannot do this with my AttributeCreator. I only have two options New Attribute and Attribute Value. How do I enable the conditional values option?

 

 

Oh nice one! That does the trick!

 

 

Reply