Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I've search and searched for a way to do this, but no method seems to work. Basically I want to use the input feature class name (feature type in FME) as the output name. This normally works, however the tool I'm using (ChangeDetector) adopts the "revised" input as the output Feature name instead of the "original" input name. Even linking the "original" input name to the output name attribute does not work. It keeps the "revised" input name. I've tried using various transformers like the SubstringExtractor to pull the name and set the writer to fan out by this attribute, but even that fails.

While I would prefer to get this working within the workbench, I do plan on using this workbench in a python script, so it would be handy to get it working through that as well. I setup the workbench to run using

subprocess.Popen(["pathToFme", "pathToWorkbench"])

This works just fine. Subsequently I tried adding parameters at the end, to input the name based on code samples I found while searching this...

subprocess.Popen(["pathToFme", "pathToWorkbench"] --fileName: "nameOfOutput")

with "fileName" being the name of the parameter within the workbench, but I can't seem to get it to run, let along pick up the parameter input from the script. I couldn't get os.system to properly execute the workbench, so I want to stay away from that.

Basically what I am trying to achieve is the ability to take a large number of inputs, run them through the changeDectector, and output with the same name as the "original" input.

Any help or suggestions would be appreciated. Thanks.

share|improve this question
    
What data format are you inputting? (shp, oracle, dxf?) –  Mapperz Dec 20 '12 at 18:54
    
A filegeodatabase feature class (ArcGIS). –  amasephy Dec 20 '12 at 19:26
    
When you access the File GDB it will lock it for that session only - you cannot create a new file geodatabase with the same name - you can only append to it. –  Mapperz Dec 20 '12 at 19:31
    
That's true, however FME definitely lets you write to the same FGDB that you read from. In this case, both the "original" and "revised" Feature Classes are in the same database. Furthermore, manually entering the name of the output filename works as expected. Fanning out by attribute is the problem. –  amasephy Dec 20 '12 at 19:50

2 Answers 2

If I understand you want to output feature class name to be the same as the original right?

  1. On the original inputs use an AttributeCopier to copy fme_feature_type (which will be the feature class name) into an attribute called _OutPutName. You might have to expose the fme_feature_type attribute in one of the source feature types to see it.

  2. In the destination feature type set "Fanout by Attribute" to the attribute _OutPutName.

Now in the destination geodatabase you should get a separate feature class for each distinct source. Of course we are assuming they all have the same schema. If not there is a way to deal with that as well.

share|improve this answer

Can you not reverse the inputs, swap the revised and original datasets in the change detector? Does that work? (You need to change your added and deleted logic around is all.)

Otherwise, try exposing fme_feature_type and doing as Ken Bragg suggests, but keep in mind also using the 'Dynamic Schema' function.

IN fact, if you're writing to the same dataset that you read from, even if you go through a change detector, using Dynamic Schema and pointing tot he original data source should just work.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.