Skip to main content

I am using feature readers to dynamically read features from a schema. The features are passed in to the FMW script in FME Server from a web interface so the feature readers don't know at design time what the features are.

To write the features I'm using generic writers. The feature readers pass the schemas to the writer, which then know which attributes to write and also knows which format to write (this is passed in from the web inteface too). The name of the output feature comes from the fme_feature_type attribute.

This works well for shapefile outputs, but for file base outputs like DWG and KML, the writer makes the name of the file the same name as the output folder. I am writing five features, so my output folder names are "one", "two", "three", "four", "five". When I write to shape output the file name becomes "PARCEL.shp", that is, whatever the FeatureReader reads. But for DWG and KMO the filename becomes "one.dwg", or "one.kml", etc.

How do I get these dynamic writers to write a "PARCEL.dwg" or "PARCEL.kml" file?

Thanks

For Shape (a folder based dataset, the file name is the name of the feature type). For file based datasets (DWG, DGN etc) the file name settings are in the writer (Fanout).

See attached image.

Hope this helps.


For Shape (a folder based dataset, the file name is the name of the feature type). For file based datasets (DWG, DGN etc) the file name settings are in the writer (Fanout).

See attached image.

Hope this helps.

There is no attribute in the Fanout Dataset dialog that produces the feature name. They all come out as 1.dwg, 2.dwg, etc.

 

 

Thanks

 

 


There is no attribute in the Fanout Dataset dialog that produces the feature name. They all come out as 1.dwg, 2.dwg, etc.

 

 

Thanks

 

 

Could you use @Value(fme_feature_type) ?

 


Could you use @Value(fme_feature_type) ?

 

No, the Attribute To Fanout on form element is a selection box, you can't enter free text in there.

 

 

The writers write folders named "1", "2", etc, then write "1.dwg", "2.dwg" in these folders.

 

 


No, the Attribute To Fanout on form element is a selection box, you can't enter free text in there.

 

 

The writers write folders named "1", "2", etc, then write "1.dwg", "2.dwg" in these folders.

 

 

What version of FME are you using.

 

This is the image for 2016.1:

 

It allows you to add any text as a Fanout expression on the Generic writer.

 


For Shape (a folder based dataset, the file name is the name of the feature type). For file based datasets (DWG, DGN etc) the file name settings are in the writer (Fanout).

See attached image.

Hope this helps.

We are using FME Desktop and Server 2015 and will not be using 2016 versions until next year.

 

 


We are using FME Desktop and Server 2015 and will not be using 2016 versions until next year.

 

 

I see: I have opened FME 2015 and see the same.

 

If you use an AttributeExposer transformer for the fme_feature_type you can use that attribute as the Fanout attribute.

 

 


That did it, @erik_jan, thanks for your work on this.


That did it, @erik_jan, thanks for your work on this.

Now I have another change with these outputs. The file outputs always have the fme_feature_type name, but we want to change the filenames to something more user friendly; for example, the output for the TRANSITROUTE table is always TRANSITROUTE.gpkg, kml, etc, but we want the output files to be "Vancouver Bike Routes.gpkg", "Vancouver Bike Routes.kml", etc.

 

 

I am calling this workspace from a workspace runner in another workspace and can easily pass in the user friendly name that I want. However, when I try to write the output as that name it fails. Is it possible with a dynamic writer to specify another name rather than the fme_feature type?

 

 

As a workaround I am calling Python in the shutdown script and renaming the file outputs. However, this only changes the file name, not the feature type names inside the file. So when I open up "Vancouver Bikeways.gpkg" I still see "TRANSITROUTE" in the feature list.

 

 


Reply