Skip to main content

Hello,

 

 

I
have to read sources that have the same structure in n paths all
structured in the same way that I therefore designate to read by .....
dep \\ com ??? \\ shape \\ parcel.shp. ??? Is
001, 002, 003, etc ... No problem for reading. However, I would like the destinations to be written each
time in a subdirectory (example: ..... dep \\ com ??? \\ shape \\ l93 \\
parcel.shp.

 

 

Can you help me ?

 

 

Thank you.

The trick is that initially you need to add the writer as normal.

When the writer is in the workspace, you can set 'Fanout Dataset' in the Navigator by expanding the writer.

The 'Fanout Dataset' (immediately below the Destination) is set to No. Double click on it and you can set the 'Fanout Expression'. Enter the subfolder without the backslash as first or last character, eg: 'dep\\com ???\\shape'

When you click OK, the 'Fanout Dataset' changes to 'Fanout Expression'

(You can also build up the subfolder in an attribute and set it as Fanout Expression if you want to write different features to different subfolders.)


Good evening,

 

Is this valid on the 2012 version SP4 ?

 

That's what I did.

 

Unsuccessful for now.

Thank you.


This is very similar to a question I answered on GISStackExchange - a link to the question (and answer, with movie demo) is here: https://gis.stackexchange.com/q/245057/454

In short, the fanout is the way to go (yes it will work in 2014) and you can use user attributes to accept input for the subfolder name, if you wish.


Good evening,

 

Is this valid on the 2012 version SP4 ?

 

That's what I did.

 

Unsuccessful for now.

Thank you.

Sorry, are you going to write the output files to a different folder structure only? Eg:

 

from: N:\\Global\\dep\\com???\\shape\\parcel.shp

 

to: N:\\Global\\dep\\com???\\shape\\l93\\parcel.shp

 

 

The format attributes:

 

- fme_dataset: full path filename (eg: N:\\Global\\dep\\com???\\shape\\parcel.shp)

 

- fme_feature_type: file name part (eg: parcel.shp)

 

 

The settings should be:

 

- Répertoire de répartition: N:\\Global\\dep\\

 

- Attribut de répartition: an attribute that holds the subfolder string, eg: com???\\shape\\l93 You need to create this attribute by copying fme_dataset to a new attribute and manipulate it with the string editing transformers.

 

- You can set the output filename somewhere else. Double click the output feature type and in the General tab set the Shapefile Name to fme_feature_type.

 

 


Reply