4

I am fairly new to the FME and don't have much hands on with all the available transformers.

I have a task to save two different sets of clipped data (via clipper transformer) into the multiple GDBs. I will try to explain in brief below:

I have a dump of road network data of two different timelines for one of the state in India. Also I have a polygon shapefile containing administrative areas of the same respective state.

enter image description here

I need the output containing clipped data of both the road shape into one GDB based on all administrative areas present in the polygon shape of the admin. In FME, I don't have any idea about how to create a writer that can write the output in multiple GDBs.

In short, I seek help from anyone who can help to set up my workbench which will help me to write the clipped data coming from two different timeline into the multiple GDBs (respective administrative areas).

3

The answer by @FSimardGIS is good, but I'll add an alternative method and a couple of thoughts.

You'll probably want two different tables - one for roads, one for polygons - since I don't think you can write different geometry types to the same table. See the parameter for Geometry (in both the FeatureWriter and a normal feature type). You can set it to polygon or line, but not both. So have two and set geometry to polygon for the admin areas and set it to lines for the road features.

So, the alternative method is to use a normal writer instead of the FeatureWriter transformer. In the Navigator window look for the Fanout Dataset option and double-click it:

enter image description here

That'll open a dialog in which to set the output name. Notice how I'm using NeighborhoodName as the attribute to "fan out" by:

enter image description here

Virtually the same as the FeatureWriter method, but I know some people prefer this method (FeatureWriter is probably the future, but old ideas die hard).

The other thing to remember, is that if you want the attributes from the areas on the line features, when they are written to GDB, you can do that by adding them to the writer feature type (for example, if you want the name of the admin area attached to each road).

I've made a small demo workspace and put it on Dropbox. You'll need FME2018.1 to open it.

  • Thanks a lot for the feedback. Actually I want to save two outputs which I have clipped from inside a polygon layer. And both the clips should be saved in a single gdb which must have a naming convention of the same polygon which is happen to be a district ID. So I need a transformer who will help me to save each output in a separate gdb based on each admin area. So that it will save my time and space to run it individually for each district separately. Thanks a lot for the help. looking forward for the reply. – Shreyas Bhogte Dec 6 '18 at 4:56
  • 1
    I have used your feedback and used fanout method to create the multiple gdb's. For now I have completed 806 gdb creations based on the available admin areas.Thanks a lot for your time and efforts. I really appriciate :) – Shreyas Bhogte Dec 7 '18 at 4:57
  • Excellent. I was just about to reply to your last comment - but it seems you have it all in hand. – Mark Ireland Dec 7 '18 at 15:21
2

In FME, there is a transformer called "FeatureWriter" that can be used to specify Writer datasets by attribute. If you create an attribute containing the path of your desired geodatabase output location and name, you can then set the FeatureWriter to write to the location specified in that attribute. If several different values are present in your attributes, the FeatureWriter will write features in separate geodatabases based on those values.

For the setup, you could use a StringConcatenator, that would concatenate the folder path, the "\" sign, your admin region attribute, and ".gdb" into a "_gdbPath" attribute. Then add a FeatureWriter with format GDB and in the Dataset section, choose the previously created attribute "_gdbPath". FME will output results in one geodatabase per admin region.

You could also use the same principle to specify Feature Type names (Feature Classes) if desired.

Here is a screen capture of the setup:

FeatureWriter

  • Hi there, thanks a lot for the feedback. But while using StringConcatenator, it is asking me to specify the attribute from the road element layer. But the gdbs must be saved based on the admin area name attribute, which is present in the polygon file of the admin area from which I want to clip the road elements. So how can I specify the attribute name from the polygon layer and not the road element layer. Awaiting your reply. – Shreyas Bhogte Dec 6 '18 at 5:39
  • Did you specify to merge attributes in the Clipper options? That allows you to transfer the district attributes to the roads. – FSimardGIS Dec 6 '18 at 12:38
  • Hi There, Yes I have tried the same. All 806 gdb's have been created with respect to admin areas. Thanks a lot for your time and help. I really appriciate :) – Shreyas Bhogte Dec 7 '18 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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