Question

File identification for dwg and dgn


Hi FME,

Need the following help with the workflow:

1. From our UI user is allowed to add only DWG and DGN file

2. We want an if else statement so that if the users upload dwg, then FME can run the dwg converter workbench and if they upload dgn it runs a different dgn converter workbench. There must be some simple approach for this. Please share your suggestion.

Thank you in advance..

Regards,

Ranjit


7 replies

Userlevel 4
Badge +30

Hello @ranjit_007, has a interessant link about how can i integrate FME Desktop and API to FME Server FME Server Playground.

About your specific case to Upload files ( DWG and DGN ) has a good example to drag in Portal a file in DWG format Example Data Validation.

You can make download example and you edit to your case: in the same Workspace put a Reader DGN file and transformers to DGN process.

 

I hope this help you,

 

Danilo de Lima

Badge

Another easy way to do this, is to incorporate both workflows in one workspace. By simply creating a user parameter with 2 choices (dwg or dgn) you run one part of the workspace?

Badge +2

The FilenamePartExtractor will return the filename extension. You can then test that the extension is DWG or DGN.

The FilenamePartExtractor will return the filename extension. You can then test that the extension is DWG or DGN.

That makes lot of sense... Will try this

 

 

 

Another easy way to do this, is to incorporate both workflows in one workspace. By simply creating a user parameter with 2 choices (dwg or dgn) you run one part of the workspace?

Yes, that is what we are looking for, However haven't seen any documentation on that. New in FME so any link will be highly appreciated

 

 

Badge

Another easy way to do this, is to incorporate both workflows in one workspace. By simply creating a user parameter with 2 choices (dwg or dgn) you run one part of the workspace?

Just create a user parameter in your workspace of type 'Choice with alias'. Set DGN or DWG as the two possible values and export this again to the server. When you call the process you should be able to pass this value to the process. A simple testfilter in your workspace with be sufficient to make the distinction between to the process for dwg or dgn.
Badge +2

Hi,

1. Use Format as Directory and File Pathnames

2. Use Attribute Filter based on path_extension attribute

3. Map the appropriate format to FeatureReader transformer and read the data as required

4. Disable the feature readers before running and check whether all the files are passed to feature readers and only unwanted features are in unfiltered port. If any valid features are present in Unfiltered port (like shp file in the above example) then add the additional filter and feature reader. Once you are confirmed that you have left with unwanted (like shx,prj,dbf files of shape file are unwanted) in Unfiltered port then enable the feature readers and proceed.

Hope this help

Reply