span8
span4
span8
span4
This type of 亚搏在线workflow is set up very simply,but with maximum flexibility.Any source dataset (of the chosen format) can be selected,and it will be read and written (to the destination format) correctly.This 亚搏在线workflow creates an output that is an exact mirror image of the source dataset's schema.
The important part is that a user can change the source to a different dataset,and the translation will still work.As well,the user will not need to make any changes to the workspace.This approach is perfect for when there is a large number of Feature Types inside a dataset,each with a different schema.This approach is also useful when new Feature Types will be added to the 亚搏在线workflow in the future.
In the following example,a database (InteropolisDatabase.sdf) contains multiple Feature Types,each with a different schema.Each Features Type will be reprojected and then written dynamically using its own schema.
InteropolisDatabase.sdf contents:
1.Begin to Generate a workspace
Open FME and select the Generate Workspace tool.For the source and destination use:
2.Set the workspace to be dynamic
In the dialog,there are two 亚搏在线workflow options: Static Schema and Dynamic Schema.
If the Static Schema option is selected,each Feature Type would need to be added separately:
However,if the Dynamic Schema option is chosen,a schema-less workspace with both a dynamic Reader and Writer is created.For this example select 'Dynamic Schema'.
3.Generate
Select OK to generate the workspace.Both the Dynamic Reader and Writer will have a single Feature Type displayed,regardless of the number of Reader Feature Types selected.Add a Reprojector transformer between the reader and the writer,set the Destination Coordinate System to LL84.
In the image above Reader Feature Type is named ‘
Behind the scene,the Reader Feature Type has been configured to read all features regardless of Feature Type name by setting the merge filter to an asterisk (*).
The destination Feature Type has been configured to write all features with the schema defined by the source dataset.
Note: Individual Readers and Writers can be made dynamic without having to use the Generate Workspace dialog.This is done by setting the options above in each Feature Type's properties dialog.
4.Run the Workspace
When the workspace is run,all of the InteropolisDatabase source data is read through a single feature type.
On the Writer side,the incoming "fme_feature_type" attribute (this contains the Feature Type name) is used to search the source dataset.If the correct Feature Type name is found,then that schema will be used.For example,a feature with "fme_feature_type" as "Roads" will search the InteropolisDatabase for the "Roads" dataset and when found,it will use that schema.The data will then be dynamically divided back into its component layers,using the appropriate schema to organize the original attributes and geometry type.
When a dynamic 亚搏在线workflow is created,an extra User Parameter called "Feature Types to Read" is published automatically within the workspace.
This parameter creates a quick way to change the number of Feature Types to be read.When the Workspace is run using "Prompt and Run",the user will be asked to select which desired Feature Types should be translated.
Inside the dialog,double-click "Feature Types To Read" and select the applicable feature types in the dialog that appears.For this example add BusStops,CityParks and Roads.
This is especially useful if the workspace references dozens of source feature types (for example a Database) and not all of them are required during a dynamic translation run.
Since the destination Feature Type is an exact mirror of the source dataset's schema,attributes created within the workspace are not automatically added to the output.Any new attributes need to be added within the User Attributes tab on the Writer.For example,a TIMESTAMP attribute created inside the TimeStamper transformer has been added to the destination Feature Type in the image below:
When the workspace is run,any new attributes are written out to each output feature type.
Adding a Generic Reader and/or Generic Writer to this 亚搏在线workflow,could produce one single workspace capable of reading/writing any format of data,regardless of what schema it has.
Dynamic 亚搏在线Workflows: Advanced Example - Modifying the Schema Feature
Dynamic 亚搏在线Workflows: Destination Schema Derived from Multiple Sources
Dynamic 亚搏在线Workflows: Basics of Dynamics
Dynamic 亚搏在线Workflows: Destination Schema Contains Different Feature Type Names
Tutorial: Dynamic 亚搏在线Workflows
Dynamic 亚搏在线Workflows: Destination Schema is Derived from a Schema Feature
Dynamic 亚搏在线Workflows: Destination Schema is Derived from an External Dataset
Dynamic 亚搏在线Workflows: Destination Schema is Derived from a Lookup Table
Dynamic 亚搏在线Workflow Tutorial: Advanced Technique - Using the SchemaMapper
© 2019 亚搏在线Safe Software Inc |Legal