Skip to main content

Hello,

 

The goal is to convert a large amount of DWG CAD files to SHP files.

  • Each DWG file is located in a specific folder and subfolder corresponding to it’s location and level.
  • Each DWG name has a prefix component indicating the plan’s specific location and a basename indicating it’s feature type. 
    • The prefix component is identical in SHPs and DWGs
    • The basemap depends on a combination of layer(s) and geometry type.

There is also a conversion matrix identifying which combination of DWG basename, layer and geometry type result in which SHP basename.

Schema mapper & scanner are used to convert schemas based on basename only.

I can output the corresponding shapefiles as Prefix_Basename.SHP in one global output folder.

However when I try to set the dataset fanout, the folders are created but the files aren’t.

 

I created two separate shapefile writer for comparison. The general parameters are exactly the same, on the writer parameters change.

For the dynamic output folder

  • Fanout Directory= \output\temp
  • Fanout Dataset=@Value(folder_location)\@Value(folder_level)

In this the folders are created but the dataset is not created.

 

In the second reader, I don’t use the Dataset fanout and the correct outputs are created.

 

 

If I understand correcty, there is nothing ‘Dynamic’ about this export. ‘Dynamic’ has to do with different attributes for different export files. That does not seem to be the case here.

In the shapefile export you can set a Fanout, and set the fanout expression to @Value(folder_location)\@Value(folder_level).

For the individual shapefiles you can set the shapefile name to 
@Value(Prefix)_@Value(Basename) .

 

 


If I understand correcty, there is nothing ‘Dynamic’ about this export. ‘Dynamic’ has to do with different attributes for different export files. That does not seem to be the case here.

In the shapefile export you can set a Fanout, and set the fanout expression to @Value(folder_location)\@Value(folder_level).

For the individual shapefiles you can set the shapefile name to 
@Value(Prefix)_@Value(Basename) .

 

 

This is what I did, however as soon as I activate the fanout dataset, the shapefiles are not created anymore. 

When I turn of the dynamic and put the writer on automatic, the fanout dataset works. That’s why I thought the problem was somehow related.

I am under the impression that the writer with dataset fanout expects my feature types to match fme_feature_type which is not the case as I use the schema scanner group by to output the files.


Could be, I didn't look into the SchemaMapper & SchemaScanner part.


You could try updating the fme_feature_type attribute on each feature to hold the new/desired feature type name rather than the feature type name produced on reading. This has worked for me in the past.