Question

Dynamically read dgn files

  • 29 September 2017
  • 9 replies
  • 19 views

Hello,

For the updating of our topography files I'm trying to cut and merge a lot of .dgn tiles into certain logical areas and output them as dgn.For this task I have the tiles and areas as featureclasses to select where the tiles have to go and clip if needed.

I'm running into problems at the point where I have to pass the dgn files to read into the dgn(v8) reader. At first I tried doing the selction in a separate workspace, writing the result to a txt file and reading them again in a new workspace. I could not get this to work with a scripted python parameter even though I was replicating the exact string used for reading multiple files. It was either reading only the first file or none at all.

My 2nd attempt was more successful by using the FeatureReader. I merged the selecting and subsequent merging and cutting into a single workspace and it outputs the correct areas. But then I noticed my cells are missing because the FeatureReader is not exposing the IGDS attributes needed to reattach them. It seems I can not expose them using the AttributeExposer either, they're just not available.

I suppose the FeatureReader being categorized as a database transformer was a hint but in it's settings you're perfectly able to select dgn(v8) as a filetype. Am I missing some setting here to get these attributes after all?

The question now is; is there a way to get this working. Either by using my 1st method or (preferably) the 2nd? I've seen some suggestions about using the workspace runner but that is not available in the datainterop extension we're using (GIS version 10.3.1, FME 2015.0 (20150114 - Build 15245 - WIN32))

I'm not sure if I can attach a workspace from the datainterop environment here but I could try to upload the toolbox model if that helps.

Thanks in advance,

Marc


9 replies

Userlevel 4
Badge +30

Hi Marc,

About your 2nd method using the transformer FeatureReader and expose the attribute igds into this transformer.

I'm using the FME Desktop 2017 in my machine and please if in your version is enable:

1) A Creator Transformer to start my example

2) Read the DGN ( V8 ) into transformer FeatureReader and configurated the option - Attribute and Geometry Handling = Merge Initiator and Result .

3) Generic Port into transformer FeatureReader to write what attributes IGDS that i want : igds_color and igds_basename.

The Result in FME Data Inspector: The output Generic Port.

Thanks,

Danilo

Badge

Hi @portofamsterdam

 

could you please provide some more details regarding how you select what dgn-files to read? With both - DGN v8 Reader and FeatureReader - you can read multiple files and folders (with or without subfolders), you can also set filters to select ceratin files based on their names. Please check Open Advanced Browser in Add Reader dialog.

To read cells and write them back into DGN successfully, please make sure:

  • you don't Expand Named Cells while reading (please see Parameters... in Add Reader or FeatureReader > Reader)
  • you provide DGN Writer with a cell library (DGN Writer Parameters > Cell Library > Cell Library File)

 

For clarification I attached a jpg of the workspace with the FeatureReader, a toolbox with the workspaces I'm using and two .txt files created with the select tiles workspace.

 

 

 

sgeoinfo05-tekenkamermarcfme-testbox.zip

 

 

 

 

 

 

 

Hi @portofamsterdam

 

could you please provide some more details regarding how you select what dgn-files to read? With both - DGN v8 Reader and FeatureReader - you can read multiple files and folders (with or without subfolders), you can also set filters to select ceratin files based on their names. Please check Open Advanced Browser in Add Reader dialog.

To read cells and write them back into DGN successfully, please make sure:

  • you don't Expand Named Cells while reading (please see Parameters... in Add Reader or FeatureReader > Reader)
  • you provide DGN Writer with a cell library (DGN Writer Parameters > Cell Library > Cell Library File)

 

Hi @LenaAtSafe ,

 

Thank you for looking into this. I added some additional info to my main post, please let me know if you need more details.

 

Regarding the workspace with the DGN reader, I tried to recreate my best attempt (it changed a lot). As far as I can tell the scripted python parameter is creating the exact same string as when you input multiple files into the dgn reader. I get an error howerver that FME stopped working and needs to close (no specifications) when I run it.

 

 

I also checked the points you mentioned and I had the settings correct. Also if I run the dgn reader workspace with manually selcted files it works without problems and attaches cells normally (the cell library must be ok I mean).

 

 

Hi Marc,

About your 2nd method using the transformer FeatureReader and expose the attribute igds into this transformer.

I'm using the FME Desktop 2017 in my machine and please if in your version is enable:

1) A Creator Transformer to start my example

2) Read the DGN ( V8 ) into transformer FeatureReader and configurated the option - Attribute and Geometry Handling = Merge Initiator and Result .

3) Generic Port into transformer FeatureReader to write what attributes IGDS that i want : igds_color and igds_basename.

The Result in FME Data Inspector: The output Generic Port.

Thanks,

Danilo

Hi @danilo_inovacao,

 

Thank you for looking into this.

 

I'm trying to recreate your steps but could you clarify step 3 a bit for me? Do you want me to put 2 FeatureReaders after another? If so what file should I input? Or did you mean another transformer?

 

 

 

 

Userlevel 4
Badge +30

Hi @portofamsterdam,

The configuration in Step 3 is into transformer FeatureReader:

But, in your screen ( Workspace ) did you configurate this option:

Thanks,

Danilo

Badge
Hi @LenaAtSafe ,

 

Thank you for looking into this. I added some additional info to my main post, please let me know if you need more details.

 

Regarding the workspace with the DGN reader, I tried to recreate my best attempt (it changed a lot). As far as I can tell the scripted python parameter is creating the exact same string as when you input multiple files into the dgn reader. I get an error howerver that FME stopped working and needs to close (no specifications) when I run it.

 

 

I also checked the points you mentioned and I had the settings correct. Also if I run the dgn reader workspace with manually selcted files it works without problems and attaches cells normally (the cell library must be ok I mean).

 

 

Hi @portofamsterdam

 

I am sorry this workflow causes so much trouble. I suspect, FME 2015 FeatureReader might have some issues with DGNs - once you upgrade Arc/Data Interop the problem might resolve. Also, currently WorkspaceRunner is available with Data Interop license - this would be another possible solution/workaround for you.

 

Let us take a look at the toolbox. I wonder if you can also share one source dgn-file, your seed-file, and your cell library. You can also send them to support@safe.com or Lena.Bagh@safe.com if you would prefer not to share them publicly. With sample data we will be able to test - which is much better than 'mental troubleshooting' :)

 

Hi @portofamsterdam,

The configuration in Step 3 is into transformer FeatureReader:

But, in your screen ( Workspace ) did you configurate this option:

Thanks,

Danilo

Ah, it looks a bit different in my version but yes I did expose some igds fields there.

 

Apparently that does work, I didn't get any errors from it. The tester I use near the end selects elements based on igds_cell_name and it sends elements to both passed and failed so the attributes are there to work with. Also when I did some additionel checking with inpectors all the elements show the igds attributes.

 

It still doesn't link the cells to the points in the writer though.

 

 

Hi @portofamsterdam

 

I am sorry this workflow causes so much trouble. I suspect, FME 2015 FeatureReader might have some issues with DGNs - once you upgrade Arc/Data Interop the problem might resolve. Also, currently WorkspaceRunner is available with Data Interop license - this would be another possible solution/workaround for you.

 

Let us take a look at the toolbox. I wonder if you can also share one source dgn-file, your seed-file, and your cell library. You can also send them to support@safe.com or Lena.Bagh@safe.com if you would prefer not to share them publicly. With sample data we will be able to test - which is much better than 'mental troubleshooting' :)

 

Hi Lena,

 

I just send you the test data via wetransfer.

 

In the toolbox I included a new workspace in which I manually read the dgn files to check if the files were working. It runs fine for me and the cells were attached in the final products.

 

Not all cells are yet present in the cell library as it's still a work in progress but the important ones are SGR-BOOM_01 (trees) and B-SIE-WEG_LICHTMAST-SO (streetlanterns)

 

Is it known yet in which FME version those FeatureReader issues are resolved? And in which version does WorkspaceRunner make it's appearance? We will upgrade our ESRI software early next year so if we can't get this working I might be able to stretch it until then.

 

 

Please let me know if you need any more test data or explanations.

 

 

Reply