E-mail: info@safe.com • Web: www.safe.com Getting Started with FME® Desktop Safe Software Inc. makes no warranty either expressed or implied, including, but not limited to, any implied warranties of merchantability or fitness for a particular purpose regarding these materials, and makes such materials available solely on an “as-is” basis. In no event shall Safe Software Inc. be liable to anyone for special, collateral, incidental, or consequential damages in connection with or arising out of purchase or use of these materials. The sole and exclusive liability of Safe Software Inc., regardless of the form or action, shall not exceed the purchase price of the materials described herein. This manual describes the functionality and use of the software at the time of publication. The software described herein, and the descriptions themselves, are subject to change without notice. Copyright © 1994 – 2011 Safe Software Inc. All rights are reserved. Revisions Every effort has been made to ensure the accuracy of this document. Safe Software Inc. regrets any errors and omissions that may occur and would appreciate being informed of any errors found. Safe Software Inc. will correct any such errors and omissions in a subsequent version, as feasible. Please contact us at: Safe Software Inc. Suite 2017, 7445 – 132nd Street Surrey, BC Canada V3W 1J8 www.safe.com Safe Software Inc. assumes no responsibility for any errors in this document or their consequences, and reserves the right to make improvements and changes to this document without notice. Trademarks FME is a registered trademark of Safe Software Inc. All brands and their product names mentioned herein may be trademarks or registered trademarks of their respective holders and should be noted as such. Document Information Document Name: Getting Started with FME Desktop Version: FME Desktop 2011 Updated: December 2010 Fourteenth printing Safe Software Inc. iii Chapter 1 Introducing FME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 About Safe Software and FME . . . . . . . . . . . . . . . . . . . . . . . 1 About this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Installation and Licensing . . . . . . . . . . . . . . . . . . . . . . . . . . 1 What Makes FME Unique? . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Primary FME Components . . . . . . . . . . . . . . . . . . . . . . . . . . 3 FME Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 FME Universal Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 FME Quick Translator . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 FME Command-Line Engine . . . . . . . . . . . . . . . . . . . . . . 4 Other FME Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 FME Data Inspector . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 FME Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 FME Application Extenders . . . . . . . . . . . . . . . . . . . . . . . 5 FME Plug-In SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 FME Integration SDK . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Help and Tutorials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 FME Desktop Training . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 FME Community . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 FME User Central . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 fmepedia . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Chapter 2 Navigating FME Workbench . . . . . . . . . . . . . . . . . . . . . . . . . 9 Starting FME Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 What is a workspace? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Navigating Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Workbench User Interface . . . . . . . . . . . . . . . . . . . . . . . 10 Canvas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Navigator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Transformer Gallery . . . . . . . . . . . . . . . . . . . . . . . . 12 Menu Bar and Toolbar . . . . . . . . . . . . . . . . . . . . . . 13 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Additional Viewing Options . . . . . . . . . . . . . . . . . . . 15 About the Reader and Writer Gallery . . . . . . . . . . . . . . . . . 15 Format Information . . . . . . . . . . . . . . . . . . . . . . . . 15 Custom Formats . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Format Details – FME Readers and Writers Manual . . 16 Help Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Chapter 3 Understanding Workbench Concepts . . . . . . . . . . . . . . . . . . 17 Data Transformation Types . . . . . . . . . . . . . . . . . . . . . . . . . 17 Transforming Structure . . . . . . . . . . . . . . . . . . . . . . . . . 17 Transforming Content . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Schema Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 How Does FME Represent the Schema? . . . . . . . . . . . . . . 18 Viewing the Schema in FME Workbench . . . . . . . . . . . . . . 18 Feature Type Properties . . . . . . . . . . . . . . . . . . . . . 19 Chapter0Contents Contents iv Getting Started with FME Desktop Editing Schema . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Schema Mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Feature Type and Attribute Mapping . . . . . . . . . . . . . . . . . 22 Schema Mapping in FME Workbench . . . . . . . . . . . . . . . . . 22 Feature Type Mapping in FME Workbench . . . . . . . . . . . . . 23 Attribute Mapping in FME Workbench . . . . . . . . . . . . . . . . 23 Content Transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Geometric Transformation . . . . . . . . . . . . . . . . . . . . . . . . 24 Attribute Transformation . . . . . . . . . . . . . . . . . . . . . . . . . 25 Using Transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Chapter 4 Setting up a Workspace . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Creating a New Workspace . . . . . . . . . . . . . . . . . . . . . . . . . 27 Refining the Reader and Writer . . . . . . . . . . . . . . . . . . . . . 29 Defining Writer Characteristics . . . . . . . . . . . . . . . . . . . . . 29 Using the Default Coordinate System . . . . . . . . . . . . . . . . . 30 Changing Coordinate System Parameters . . . . . . . . . . . . . 30 Adding Transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Locating Transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Placing a Transformer . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Quick Add . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Inserting a Transformer into an Existing Link . . . . . . . 32 Quick Connect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Transformer Parameters . . . . . . . . . . . . . . . . . . . . . . . . . 34 Properties Button Colors . . . . . . . . . . . . . . . . . . . . . 34 Transformer Colors . . . . . . . . . . . . . . . . . . . . . . . . . 34 Transformer Ports . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Multiple Transformers . . . . . . . . . . . . . . . . . . . . . . . 34 Custom Transformers . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Detailed Transformer Help . . . . . . . . . . . . . . . . . . . . . . . . . 35 Transformers Reference Guide . . . . . . . . . . . . . . . . . . . . . 35 Creating a Custom Format . . . . . . . . . . . . . . . . . . . . . . . . . 35 Organizing the Workspace . . . . . . . . . . . . . . . . . . . . . . . . . 36 Using Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Creating a Bookmark . . . . . . . . . . . . . . . . . . . . . . . 36 Creating Annotations . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Attaching Default Annotations to Multiple Objects . . . 37 Summary Annotations . . . . . . . . . . . . . . . . . . . . . . 38 Using the Feature Count Display . . . . . . . . . . . . . . . . . . . . 38 Running the Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Completing the Translation . . . . . . . . . . . . . . . . . . . . . . . . 39 Running a Batch Translation . . . . . . . . . . . . . . . . . . . . . . . . 39 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Chapter 5 Using FME Quick Translator . . . . . . . . . . . . . . . . . . . . . . . . 41 Specifying the Reader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Merging Similar Datasets . . . . . . . . . . . . . . . . . . . . . . . . . 42 Reader Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Converting Coordinate Systems . . . . . . . . . . . . . . . . . . . . . 43 Choosing from the Coordinate System Gallery . . . . . . . . . . 43 Viewing the Reader Dataset . . . . . . . . . . . . . . . . . . . . . . . . 44 Entering Writer Information . . . . . . . . . . . . . . . . . . . . . . . . 44 Writer Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Contents Safe Software Inc. v Choosing a Mapping File . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Deciding on the Next Step . . . . . . . . . . . . . . . . . . . . . . . . . 45 Switching to FME Workbench . . . . . . . . . . . . . . . . . . . . . . 45 Performing a Basic Translation . . . . . . . . . . . . . . . . . . . . . 45 Running the Translation . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Running a Batch Translation . . . . . . . . . . . . . . . . . . . . . . 46 Stopping a Translation . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Saving Log Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Copying and Searching Log Text Information . . . . . . . . . . . 46 Completing the Translation . . . . . . . . . . . . . . . . . . . . . . . . 47 Viewing the Output File . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Chapter 6 Using FME Universal Viewer . . . . . . . . . . . . . . . . . . . . . . . . 49 Starting FME Universal Viewer . . . . . . . . . . . . . . . . . . . . . . 49 FME Universal Viewer Interface . . . . . . . . . . . . . . . . . . . . . 50 Using Viewer Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Using Viewer Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Adding a Dataset to the Viewspace . . . . . . . . . . . . . 52 Removing a Dataset from the Viewspace . . . . . . . . . 52 Customizing Feature Types . . . . . . . . . . . . . . . . . . . 52 Reordering Feature Types . . . . . . . . . . . . . . . . . . . . 53 Setting View Options . . . . . . . . . . . . . . . . . . . . . . . 54 Showing the Information and Log Windows . . . . . . . . 55 Performing Additional Tasks . . . . . . . . . . . . . . . . . . . . . . . 56 Marking a Location on a Dataset . . . . . . . . . . . . . . . . . . . 56 Measuring Distances . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 Showing Dynamic Attributes . . . . . . . . . . . . . . . . . . . . . . 57 Filtering Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Contents vi Getting Started with FME Desktop Safe Software Inc. 1 1 Chapter1Introducing FME About Safe Software and FME One of the most compelling questions for organizations today is the question of where? Using spatial data, business leaders, managers, and spatial data experts can all get more information and better answers to drive more accurate decision making and planning. The next most compelling question is often: How do we use this data? The enormously diverse range of spatial data formats and evolving standards often means that interoperability can become a big challenge. At Safe Software, we’re dedicated to making sure that FME will always help you do the most with your spatial data. Built by experts from every corner of the industry, the FME technology platform sets a higher standard for transforming spatial data to use and share. It solves more spatial data transformation challenges across more formats than any other solution, making it easier for professionals to solve their data interoperability problems. About this Manual When you are working with FME Desktop, what you can do with the resulting data is almost unlimited – every user can have a different requirement, depending on the task, the source data, and the type of transformation. For that reason, this Getting Started manual covers only basic concepts and workspace setup. For intermediate or advanced Workbench examples, it is recommended that you download and work through the FME Tutorial, available on our website at www.safe.com or on your FME installation disk. The FME Tutorial includes sample data and a workbook. Taking an FME Training course is also highly recommended. FME components contain detailed on-line help, available from each Help menu or separately on the FME disk. Installation and Licensing Instructions for installing and licensing FME are available in the FME Installation and Licensing Manual, available on our website. What Makes FME Unique? FME provides unrivalled format support for data translation and integration, and unlimited flexibility in data model transformation and distribution. 2 Getting Started with FME Desktop Introducing FME Format Support FME is a central engine in the midst of over 200 formats. You can read from any supported format and write to any supported format. Data Model FME’s data model is designed to cover all possible geometry and attribute types. You can accurately restructure the schema of your data as it moves from the source to the destination, without losing semantic information. FME is also smart enough to compensate automatically for limitations in a destination format to create a seamless translation process whenever possible. Translate, Transform, Integrate FME has what traditional format translators lack: the ability to also transform the data. You can work with an entire dataset or isolate specific feature types or attributes, and then add transformers to manipulate the data so you get the output that you want. FME includes a gallery of over 400 powerful transformers that provide tremendous functionality. Safe Software Inc. 3 IntroducingFME 1 Primary FME Components FME Workbench FME Workbench has an intuitive point-and-click graphic interface that enables you to visualize the data flow. FME Workbench is the primary tool for data translations in FME. FME Workbench offers powerful transformation and translation capabilities traditionally reserved for custom software solutions. Using Workbench, you can graphically adjust the way your data flows from its source to the destination. If you want to add customizations or detailed transformations, including those that require multiple input and output formats, FME Workbench is the best tool. 4 Getting Started with FME Desktop Introducing FME FME Universal Viewer FME Universal Viewer allows quick viewing of data in any of the FME-supported formats. It is used primarily for data validation and quality assurance by allowing you to preview the data before translation, or review it after translation. FME Quick Translator For simple translations that do not involve any customization, you can get quick results by using the FME Quick Translator. Advanced FME users can also run custom mapping files through this interface. FME Quick Translator (originally called the FME Universal Translator) was the first FME application to be developed. Translations are defined through a scripting language rather than a graphic interface. For this reason, the Quick Translator is largely superseded by FME Workbench; however, as its name suggests, it is good to use for quick, formatto-format translations. FME Command-Line Engine The FME Command-Line Engine lets you submit translation requests at the command-line level. Type fme at the command line to see a list of available commands. The FME Fundamentals manual contains more detailed information on using FME from the command line. Safe Software Inc. 5 IntroducingFME 1 Other FME Components These additional components are all included as part of the standard FME package. FME Data Inspector The FME Data Inspector is a Safe Software technology preview, intended to eventually replace the FME Universal Viewer. Although it maintains many of the same features as the FME Universal Viewer, the Data Inspector is crossplatform, it uses the latest display technology, and it supports 3D viewing. For FME 2011, users will have the option of using both the FME Universal Viewer and the FME Data Inspector. To change the default viewer, choose Tools > FME Options and click the Workbench icon. FME Objects FME Objects is a software library for working with spatial data. Application developers use FME Objects to add spatial data reading and writing support to their stand-alone applications. FME Application Extenders FME Application Extenders are components by which FME technology is used or embedded into other GIS applications. These are then known as FME Enabled Applications. Commonly Application Extenders enable a GIS product to view datasets not native to that application. FME Plug-In SDK The FME Plug-In SDK allows developers to add their own formats or functionality to the FME translation core. FME Integration SDK The FME Integration SDK allows developers to create FME-enabled applications for users who already have FME installed on the same PC. 6 Getting Started with FME Desktop Introducing FME Help and Tutorials In-depth technical reference documentation is integrated with Workbench and Quick Translator help files, and is also included on your FME installation disk and at www.safe.com/support/onlinelearning. The reference documents include: • FME Readers and Writers • FME Functions and Factories • FME Fundamentals The FME Desktop Tutorial is an ideal way to start using FME. It includes instructions and examples to help you accomplish the following tasks: • Quick Translation – Perform simple data translations with the FME Quick Translator. • Custom Translation – Transform data with FME Workbench, and create Custom Formats from existing transformations. • Data Inspection – View and query data in FME Universal Viewer. Look for the FME Desktop Tutorial on your FME installation disk and at www.safe.com/support/onlinelearning. The FME Self-Study Modules are designed to help you improve your proficiency with FME at a pace that suits your schedule. The FME self-study modules help you build the FME skills you need to solve your data integration challenges. For more information, visit www.safe.com/support/onlinelearning. FME Desktop Training Safe Software provides courses and resources for both FME Desktop and FME Server, offered at a range of skill levels. You can choose how you want to learn: in-person, on-line instructor-led, or with self-paced resources like tutorials and demos. To access these resources, visit http://www.safe.com/training/. FME Community Our online community consists of an enthusiastic group of users and Safe Software staff who participate in various online resources. These technical resources are a forum where FME users ask questions, receive help, and exchange information on FME products. We welcome and encourage questions about FME formats, processing capabilities, future plans, documentation, FME Objects, mapping files, and coordinate conversion issues. FME User Central The FME User Central website is the access point that lets you quickly source various technical resources, and the latest news and technical bulletins. To access these resources, visit http://www.safe.com/fmeusercentral. Safe Software Inc. 7 IntroducingFME 1 fmepedia fmepedia is Safe Software's user collaboration site. Based on Mediawiki, fmepedia is maintained both by Safe Software staff and members of the FME community. To access these resources, visit http://www.fmepedia.com. 8 Getting Started with FME Desktop Introducing FME Safe Software Inc. 9 2 Chapter2Navigating FME Workbench Starting FME Workbench You can start FME Workbench in the following ways. To start Workbench as a stand-alone application do one of the following: • From your desktop, click the Workbench shortcut . • From the Windows Start menu, select All Programs > FME Desktop > FME Workbench. • Use Windows Explorer find the FME folder (by default, in the Program Files folder) and double-click the Workbench icon. If you start Workbench using the preceding options, the Workbench start-up window opens. From here, you can choose a number of different start-up options. To start Workbench from Windows Explorer using existing Workbench (.fmw) files do one of the following: • Double-click a Workbench file. • Right-click the file and select Edit with FME Workbench from the command menu. • Right-click the file, and select Open With > FME Workbench from the command menu. • Drag and drop the .fmw file onto a shortcut pointing to Workbench. Workbench starts up and opens the existing workspace. To start Workbench using an existing file (other than .fmw) as input data: • Right-click a file that does not have the .fmw extension. The file can be in any format that your FME license supports. Select Transform with FME Workbench from the command menu. • You can also drag and drop the file onto a shortcut pointing to Workbench. Workbench automatically extracts the filename and type for your source data. Workbench starts and opens the New Workspace dialog with the source information already filled in. What is a workspace? A workflow that is defined in Workbench is called a workspace. Workspaces contain readers and writers (which contain format information) and their attributes, as well as transformers that manipulate the data. You can work with only one workspace at a time; however, you can start an additional FME Workbench and copy and paste information to your current workspace. 10 Getting Started with FME Desktop Navigating FME Workbench Workspace files have the extension .fmw. For a default workspace name (which you can always change), FME suggests a filename based on the formats used in the workspace. For example, if your workspace is set up to read from an ESRI Shapefile and write to both an Access MDB file and AutoCAD drawing, then shape2mdb_dwg.fmw would be the suggested default name. Navigating Workbench Workbench User Interface The Workbench user interface consists of different work areas, or windows. You can choose which areas are shown by selecting them from the View menu. You can also click the title bar of a window to drag it to a separate area of your monitor, and you can distribute the windows across multiple monitors. When you first start Workbench, by default, the layout will be as shown here. Note that this example shows an existing workspace. Legend: 1 Menu bar and toolbar 5 Log 2 Navigator 6 Status bar 3 Canvas 7 Transformer Description tab 4 Transformer Gallery tab Safe Software Inc. 11 NavigatingFMEWorkbench 2 Canvas The canvas is where you graphically define the workflow. By default, the workflow reads from left to right: the data source is on the left, the transformation tools are in the center, and the data destination is on the right. Connections between each item represent the flow of data and may branch in different directions or even lead to a dead-end if required. Navigator The Navigator is an Explorer-type tool that shows a text definition of all the components that comprise the workspace, including data, feature types, transformers, and specific parameters. You can double-click to edit most parameters. The Navigator also highlights anything that needs attention, such as transformer parameters that require input before you can run the workspace. The Navigator includes general workspace properties including name, log file name, parameter settings, and source and destination redirect instructions. Advanced properties contain parameters related to more advanced tasks, which are described in the Workbench help topic Workbench Advanced Parameters. Click the Navigator tab. Click the down-arrow to open display options. By default, the display is set to Tabbed. 12 Getting Started with FME Desktop Navigating FME Workbench Transformer Gallery In FME Workbench, source and destination data is represented by objects in the workflow. In the same way, both geometric and attribute restructuring are represented by objects called Transformers. The Transformer Gallery stores all transformers. The layout of Workbench windows may vary if you have changed your settings, but by default the Workbench Navigator will display a Transformer Gallery tab. Click this tab to view the transformer list. Finding the right transformer for the task at hand can be challenging; however, there are a number of different resources that can help you narrow down your choices. The Transformer Gallery is organized into different folders depending on each transformer’s function category, or by transformer name, under the All folder. There are other folders that contain previous search results, recently used transformers, and custom transformers that may be embedded in a workspace. You can also create your own folders. In the Search field, you can search for keywords related to the task you want to perform, such as rename or join, or you can search for a common element, such as 3D or raster. Displaying Help Open a folder and click a transformer to view a description of its function. This description is displayed in the Transformer Description area of the Workbench interface. To show the entire Transformer help file, choose Help > FME Transformers, or select a transformer in your workspace and press the F1 key. Adding a Transformer to the Canvas To include a transformer on the canvas, you can drag-and-drop it, double-click the transformer name, or, once you are more familiar with transformer names, you can also use the function described in Quick Add on page 31. You can find detailed information on each transformer in Workbench’s on-line help, or by pressing the F1 key when you select a transformer in Workbench. Safe Software Inc. 13 NavigatingFMEWorkbench 2 The FME Workbench Transformers Reference Guide also provides high-level information about each transformer. Menu Bar and Toolbar The menu bar and toolbar contain a number of shortcuts; for example, tools for navigating around the workspace, controlling administrative tasks, and adding or removing source datasets. In general, the pull-down menus on the menu bar contain commands that affect the entire workspace, whereas individual command menus within the graphical interface (shown by right-clicking your selection) are applicable to separate workspace components. You can customize the toolbar to include specific buttons and even often-used transformers. Right-click in a blank area of the toolbar and select Customize Toolbar. To see what a tool does without actually selecting it, float your cursor over the button to view a short description of its function (tooltip). Overview The Overview window (View > Windows > Overview) shows a view of the entire workspace and highlights a selected portion of the canvas. It is not meant to show detail; however, it can help orient you when you are working in a large workspace. You can resize the magnifier to focus on certain areas of a workspace. Note: FME Professional Edition contains more transformers than FME Base Edition. For details, see the on-line help, or visit the Products page at www.safe.com. 14 Getting Started with FME Desktop Navigating FME Workbench The example here shows an Overview window that has been moved to the righthand side of the Workbench main window. The magnifier shows the area in detail on the left. Log The Log shows statistics and processing information that includes the following: • FME version • reader being used • writer being used • logging information • warning messages • command line information, including published parameters Information messages are shown until the translation is complete. When the translation is complete, you can search for text, copy selected contents of the window directly to another application, or save the contents to a text file. In the event of an error message or unexpected output, you can analyze the workspace to find which error has been introduced into the workflow definition. The log window is the most important place to look for information if a translation does not complete as you expected. Safe Software Inc. 15 NavigatingFMEWorkbench 2 Additional Viewing Options Additional windows show lists of feature and attribute connections. The status bar at the bottom left-hand side of Workbench displays progress information, as well as tooltips. About the Reader and Writer Gallery The Reader and Writer Gallery is a list of all formats supported by your FME license. To open it, click the Tools menu and select Browse Readers and Writers. Format Information The Reader and Writer Gallery includes the following information about each format. Column Name Description Description This column shows the full format name. Short Name This column shows the common abbreviation for the format name. Extensions This is the file extension associated with the format. Type This is the format type, either directory-based or file-based. Read/Write Read/Write columns show whether FME reads the format, writes the format, or both. Coord. Sys. This column indicates whether a custom coordinate system is associated with the format. 16 Getting Started with FME Desktop Navigating FME Workbench Custom Formats The Custom Formats area of the gallery contains buttons for adding, importing, editing, and removing custom formats. This is considered an advanced FME task. For information, see Custom Formats in the Workbench help file. Format Details – FME Readers and Writers Manual To view detailed technical information about a format, select a format name in the list and click the Details button. This opens the applicable format chapter in the FME Readers and Writers manual. Help Files Select FME Workbench Help from the Help menu or visit www.safe.com/ support/onlinelearning. Licensed Some formats require that you obtain special licensing or specific editions of FME Desktop. This column indicates whether your FME is licensed to read/write the format. Note: You can't edit the parameters for any of the columns listed above – double-clicking a checkmark only selects the format and closes the window. Search field To filter the format list and show only matching formats, type a keyword, a few characters, or a file extension. Column Name Description Safe Software Inc. 17 3 Chapter3Understanding Workbench Concepts Although FME can easily move data from one format to another, it is much more than just a translator. Data transformation is FME's ability to restructure data through the use of transformers. One of the key features is that the transformation automatically takes place between the reading (extract) and writing (load) of data. By combining transformers in interesting ways, you can resolve a variety of translation and transformation challenges. For users who are familiar with FME, transformers are best described as packages around FME functions and factories, which are documented in the FME Functions and Factories manual). In fact, most transformers include a reference to a related function or factory. Just like functions and factories, some transformers add attributes to features, others erase attributes, and still others operate on the geometry. Transformers may operate on individual features one at a time or on groups of features. When the output from the Reader feature type or a transformer is connected to another transformer, Workbench makes an implicit connection between all attributes that have the same name. If necessary, Workbench automatically assigns attributes to transformers based on both the transformer itself (usually one specific attribute like count or length, for example) and then appends the attributes contained in the input connection. Data Transformation Types Data transformation can be subdivided into two distinct operations. Transforming Structure This type of transformation is also known as reorganizing. It refers to FME’s ability to channel data from source datasets to destination datasets in an almost infinite number of arrangements. This includes the ability to merge data, divide data, reorder data, and define custom data structures. FME transforms the structure of a dataset by manipulating its schema. Transforming Content This type of transformation is also known as restructuring. It refers to the ability to alter the content of a dataset: manipulation of a feature's geometry or attribute values is the best example of how FME can transform content. Schema Definition A schema (or data model) is the structure of a dataset or, more accurately, a formal definition of a dataset's structure. 18 Getting Started with FME Desktop Understanding Workbench Concepts Each dataset has its own unique structure (schema) that includes feature types, permitted geometries, user-defined attributes, and other rules that define or restrict its content. A schema is a physical representation of the data. How Does FME Represent the Schema? When you create a new workspace, FME reads the source dataset and creates a workspace definition of the schema. Usually, FME also creates a placeholder for the destination schema; that is, a definition of the structure of the destination dataset. The example below shows the source and destination schema as they appear in Workbench. Source data is on the left and destination data is on the right. Each item is a separate feature type, so the example shows one Reader feature type and one Writer feature type. Each feature type has a set of attributes. Connections between each item represent the flow of data. These connections can branch in different directions, or even lead to a dead-end. You will see a similar view to the one shown here after you generate the initial workspace and before you add any customizations like new attributes or transformers: A new workspace usually has identical reader and writer feature types; however, this is not always possible, particularly when the reader and writer formats are different. In these circumstances, FME attempts to compensate for any differences between reader and writer feature types. For example, attribute names may be shortened to compensate for formats that do not support attribute names over a certain number of characters. Viewing the Schema in FME Workbench A schema is made up of many components. Some of these relate to a dataset as a whole; for example, feature types belonging to a dataset are regarded as part of the overall schema and are depicted in the Workbench canvas. However, some parts of the schema relate specifically to a single feature type only. Attributes are one such component. These components are shown in the Properties dialog of a feature type. Click the Properties button on the feature type to open the dialog. Safe Software Inc. 19 UnderstandingWorkbenchConcepts 3 Feature Type Properties The Feature Type Properties dialog contains detailed information about the feature type. The General tab shows the name of the feature type, permitted geometry types, as well as the parent dataset. Clicking the Details button displays the feature representation help topic for the applicable format. Merge Parameters are useful when you have files that contain numerous layers, you have similar source schemas, and you want to merge all similar feature types for further processing, based on a matching pattern. The User Attributes tab shows a list of attributes present on the feature type. Each attribute is defined by its name, data type, width, and number of decimal places. This example shows a reader feature type, therefore, the attributes are greyed-out and not editable. Note, however, that there is an option in Workbench that allows you to edit some reader feature type properties (suitable mainly for testing purposes). For information, see Editing Reader Feature Type Properties in the Workbench help file. The attributes on a destination dataset can be edited to create the required output. 20 Getting Started with FME Desktop Understanding Workbench Concepts Editing Schema The default schema that FME creates is suitable for a quick translation. When you need to customize the output schema, you can use Workbench to make the edits. Schema editing is the process of altering the destination schema to customize the structure of the output data. For example, you can: • rename an attribute • change an attribute type • rename a feature type • change an allowed geometry type • move a feature type to a different dataset Some examples are shown below. The Format Attributes tab exposes, or makes visible, built-in FME attributes. This area allows you to connect other attributes to these special, format-specific attributes. For detailed information, look at the applicable chapter for the writer being used in the FME Readers and Writers manual. Some formats require that additional parameters be specified before they can be created in a target system. If the format supports it (usually a database format), the Parameters tab lets you set any parameters that are needed for creating a feature type in the dataset to which you are writing. Most formats do not have this tab. Safe Software Inc. 21 UnderstandingWorkbenchConcepts 3 Open the Writer Feature Type Properties dialog and click the User Attributes tab. Column names will depend on the format but in general, you can: Rename any attribute on the writer schema. Click the attribute to be renamed and enter the new name. Change the attribute type on the writer schema; for example, from an integer to a float. Use the pull-down menus in the Data Type field. Open the Writer Feature Type Properties dialog and click the General tab. Name Parameters: You can rename any feature type on the destination schema. Click on the field to enter the new name. General Parameters: Choose from the list of allowed geometries; for example, you can change the allowed geometries from lines to points. This field is disabled if the format permits all geometry types. If the workspace contains more than one writer, you can switch a feature type from one destination dataset to another. Click the drop-down list in the Dataset field. For database formats, you can enter a username to connect to the database. Click Details to display format-specific technical reference information from the FME Readers and Writers manual. Dynamic Parameters: This advanced user setting configures writers to use Dynamic Parameters. See the Workbench help topics About Dynamic Workspaces and Adding a Reader as a Resource. 22 Getting Started with FME Desktop Understanding Workbench Concepts Schema Mapping Schema mapping is the means by which you transform a dataset's structure. In FME Workbench, one side of the workspace shows the source schema (which already exists) and the other side shows the destination schema (which doesn’t yet exist). Schema mapping is the process of connecting the source schema (Reader feature type) to the destination schema (Writer feature type) in a way that ensures the correct Reader feature types are sent to the right Writer feature types and the correct source attributes are sent to the correct destination attributes. Feature Type and Attribute Mapping Feature type mapping is the process of connecting Reader feature types to Writer feature types. Attribute mapping is the process of connecting Reader (source) attributes to Writer (destination) attributes. In Workbench, feature type mapping connections are shown with a thick, black line. Attribute mapping connections are shown with a thinner, gray line. Attribute mapping is sometimes implied rather than visualized and no connection is shown. The color of the port indicates the connection status, as follows: • Green indicates a connected attribute. • Yellow indicates a source attribute that is not connected to a destination • Red indicates a destination attribute that is not connected to a source. Attributes with the same name in Reader and Writer feature types are connected automatically. Note that attribute names are case-sensitive, so ROADS is not the same as Roads or roads. Schema Mapping in FME Workbench In most cases, FME automatically fills in basic schema mapping in a new workspace. You can then edit the schema mapping as required. In Workbench's intuitive interface, feature type and attribute connections are made by pointing and clicking, or by dragging connecting lines between these parts of the schema. Safe Software Inc. 23 UnderstandingWorkbenchConcepts 3 Feature Type Mapping in FME Workbench Feature type mapping is established by clicking the output port of a reader feature type and doing one of the following: • Move the cursor to the input port of the writer feature type, and click to make the connection. • Drag the arrowhead across to the input port of a writer feature type and release the mouse button. Attribute Mapping in FME Workbench Attributes with the same names in both the Reader feature type and the Writer feature type are connected automatically. If the attributes do not have the same name, you need to manually establish attribute mapping by clicking the output port of a Reader attribute, dragging the 1 Click the reader feature type port, then click the writer feature type port. 2 Click the writer feature type port to connect automatically. Quick Connect also lets you quickly connect to multiple ports by holding down the Ctrl key and clicking the ports you want to connect. 1 2 A connecting line from Reader to the Writer feature type is being created by dragging the arrowhead from the reader to the writer. 24 Getting Started with FME Desktop Understanding Workbench Concepts arrowhead to the input port of a destination attribute, and releasing the mouse button. To save time in this situation, you can use the AttributeCopier transformer. To see an example, click Help > FME Transformers. In the FME Transformers help window, search for AttributeCopier. Content Transformation Content transformations are those that operate on the geometry or attribute content of a dataset. Features A feature in FME is an individual item within the translation. Typically a GIS or cartographic feature consists of a geometric representation plus a set of related attributes. FME is capable of restructuring either of these components. A feature in FME is the fundamental (that is, smallest) unit of FME data. Features have a flexible, generic representation. In other words, they have a basic FME definition that is unrelated to their parent format. Using FME, you can process data during a translation to produce a destination dataset that is greater than the sum of its source components. Geometric Transformation Geometric transformation is the act of restructuring the spatial component of an FME feature. In other words, the physical geometry of the feature undergoes some form of change to produce a different output. Here are some examples of geometric transformation: • Generalization – a cartographic process that restructures data to be more easily visualized at a given map scale. • Warping – adjustment of the size and shape of a set of features to more closely match a set of reference data. • Topology Computation – conversion of a set of linear features into a node/line structure. In this example, feature type mapping has already been established and attributes are being connected. As the connections are made, the arrow colors change from yellow and red to green. Safe Software Inc. 25 UnderstandingWorkbenchConcepts 3 Attribute Transformation Attribute transformation is the act of restructuring the non-spatial component of an FME feature. In other words the attributes relating to the physical geometry undergo some form of change to produce a different output. Some examples of attribute transformation are: • Concatenation – joining two or more attributes. • Measurement – measuring a feature's length or area to create a new attribute. • ID Creation – creating a unique ID number for a particular feature. Using Transformers Just as source and destination data are represented by objects on the Workbench canvas, the tools used for geometric and attribute restructuring are depicted by objects called Transformers. For more details on using Transformers in Workbench, see Adding Transformers on page 31. Note that not all Workbench transformers are available in FME Base Edition. For details, see the Transformer section of our website or view the Workbench help. 26 Getting Started with FME Desktop Understanding Workbench Concepts Safe Software Inc. 27 4 Chapter4Setting up a Workspace The previous two chapters covered Workbench navigation, and basic terminology and concepts. This chapter shows you how to set up and run a basic workspace. Creating a New Workspace There are several ways to create a new workspace: • Create a blank workspace so you can add readers, writers, and transformers directly on the canvas. • Generate a workspace by entering information in a dialog box. • Generate a workspace using a wizard to fill in the workspace elements. • Start with a template. For the purposes of this chapter, you can start with the Workspace dialog. 1 Start Workbench. From the Start tab, click Create Workspace. 2 In the New Workspace dialog, click Generate Workspace. The New Workspace dialog opens: 3 In the Reader Format field, do one of the following to populate the field: • Type the reader’s format name. As you type, the auto-search function will suggest formats based on what you are typing. • Open the pull-down menu and select from recently used formats. 28 Getting Started with FME Desktop Setting up a Workspace • Click the Browse button to open the Reader Gallery (which contains only formats that FME reads). From here you can type the format name in the Search field or scroll through the list to find and select the format. Click OK to accept the selection and close the gallery. 4 Click the browse button beside the Reader Dataset field, and browse to the location of your source data. Note: It is sometimes faster to perform this step first, before choosing the data’s format. When you add the Reader Dataset first, FME will populate the Format field based on the dataset type. 5 The Parameters button becomes available for certain readers. These parameters allow you to specify more detailed information about the source data, but you can always accept the defaults that FME provides. You do not have to click the button to accept the parameter defaults. For help with specific parameters, press the F1 key from within any Parameters box. 6 The Coord. System field will usually say Read from Source. You can accept this default in most cases. Clicking the browse button beside this field will display the Coordinate System Gallery, which contains all the coordinate systems that FME supports. See Using the Default Coordinate System on page 30. 7 In the Writer Format field, do one of the following to populate the field: • Type the writer’s format name. As you type, the auto-search function will suggest formats based on what you are typing. • Open the pull-down menu and select from recently used formats. • Click the Browse button to open the Writer Gallery (which contains only formats to which FME writes). From here you can type the format name in the Search field or scroll through the list to find and select the format. Click OK to accept the selection and close the gallery. 8 The Parameters button becomes available for certain writers. These parameters allow you to specify more detailed information about the destination data, but you can always accept the defaults that FME provides. You do not have to click the button to accept the parameter defaults. For help with specific parameters, press the F1 key from within any Parameters box. 9 The Coord. System field will usually say Same as Source. You can accept this default in most cases. Clicking the browse button beside this field will display the Coordinate System Gallery, which contains all the coordinate systems that FME supports.See Using the Default Coordinate System on page 30. 10 You can also enter a name and location for the destination data, although FME will create the workspace without this information. You will be prompted again to enter the information before you actually run the workspace. 11 Click OK to generate the new workspace. The translation Log shows statistics and processing information. If you closed the Log, you can see a subset of logging information in Workbench’s status bar. Safe Software Inc. 29 SettingupaWorkspace 4 When you save your workspace, the default workspace name mirrors the formats you are translating (for example, shape2dwg.fmw). You may want to use a more specific filename. Initially, you see the Reader feature types and a representation of the Writer feature types. Refining the Reader and Writer After you initially set up your workspace, you can perform a number of tasks to customize the workspace. For example, you can: • add additional readers or writers • import or remove feature types • combine or fan out feature types • rename objects in the workspace • combine data from multiple sources More Information Select FME Workbench Help from the Help menu and open the Readers and Writers topic. Defining Writer Characteristics When FME generates the initial workspace, it reads the feature types from the source data. First, you might want to rename the Writer feature type so the name more closely reflects what you want to see in the output data. You might also want to change the attributes, by deleting or renaming them, or by editing their properties. When the output from the Reader feature type is connected to the Writer feature type, there is an implicit connection made between all attributes that have the same name. When you rename an attribute or add a new attribute, you must physically connect the ports to create the links you want. In this example, Workbench has established the connections automatically because the feature type and attribute names are the same. This was described in Schema Mapping on page 22. 30 Getting Started with FME Desktop Setting up a Workspace Using the Default Coordinate System Each feature that is processed by FME is coordinate-system aware, which helps prevent confusion when reading multiple datasets belonging to different coordinate systems. Each reader and writer in FME is assigned a default coordinate system. This coordinate system is shown in the Navigator. For formats that know their coordinate system, the Coordinate System for the source dataset shows “Same as source” and FME reads the coordinate system from the source dataset. For most other input sources, the field shows , which means that FME uses default values or reads the coordinate system from the source data. You can explicitly set the source coordinate system (which overrides any coordinate system read from the source), but, in most cases, you do not need to change the default parameter. When the destination coordinate system is also marked (as shown in the above example), FME does not reproject the data, but writes it using the same coordinate system as the source data. Changing Coordinate System Parameters FME’s Coordinate System Gallery includes more than 60 projections and thousands of predefined coordinate systems. You can also define your own custom coordinate systems, ellipsoids, datums, and units. When a translation is defined so that the source and the destination coordinate systems differ, FME automatically restructures the data at the end of the translation so that the output is in the correct location. More Information Select FME Coordinate Systems from the Workbench Help menu. If the Coordinate System parameter reads , FME will use default values or read the coordinate system from the source data. Safe Software Inc. 31 SettingupaWorkspace 4 Adding Transformers Just as readers and writers are represented by objects on the Workbench canvas, the tools used for geometric and attribute restructuring are represented by objects called Transformers. An introduction to transformers was given in the section Transformer Gallery on page 12. Two basic rules for transformers are: • You can use the output from one transformer as the input to another. • You can send the output from one transformer to more than one destination. This section describes the different methods used to locate, add, and place transformers. If you know which transformer you need, see Quick Add on page 31. This is the fastest way to include transformers in your workspace. Locating Transformers The transformer search tool is one way to locate a transformer that matches your needs. Enter a keyword (or multiple keywords) and click the Search button. The results will appear in the Search Results folder. Placing a Transformer When you've located a transformer in the Transformer Gallery, double-click it to place it in the workspace canvas. You can also drag and drop a transformer onto the workspace canvas. This gives you greater control over where the transformer is initially positioned. After the transformer is placed on the canvas, you can include it in the workflow by dragging connections onto the input port(s) and by dragging connections from the output port(s). Quick Add After you have worked with FME and you are a little more familiar with Transformers, Quick Add is the easiest and fastest way to add transformers to your workspace. Quick Add is a search bar that is embedded in the workspace canvas. A Tester transformer has been placed and connected in the workspace. 32 Getting Started with FME Desktop Setting up a Workspace 1 On the menu bar, click Tools > FME Options, and then click the Transformers icon. Make sure that Auto connect after Quick Add is checked. 2 Click on a blank area of the canvas and type any letter. For this example, let’s say you want to add a TINGenerator transformer. Start typing the letters gener... As you begin to type, the Quick Add drop-down menu appears on your canvas. As you continue to type more letters, the menu will change depending on the matches in the Transformer Gallery. In this example, FME finds a number of matches based on the letters: 3 Scroll and select the TINGenerator, and the transformer is immediately placed on your canvas. If you continue to scroll down the search box, there is a field named {Search for “gener”}. If you select it, Workbench will search not only transformer names, but also keywords. The results appear in the Search Results folder at the bottom of the Transformer Gallery. Tips: • Select a feature type or another transformer before you initiate the Quick Add search and the transformer will automatically connect to your selected object. • Type the slash / character. Workbench will remember the last transformer you added, and display it in the search bar. Press Return to add it to the canvas. You can do this as many times that you want to add the same transformer: Inserting a Transformer into an Existing Link You can insert a transformer into a link by holding it over an existing connection. When you release the transformer, it is set in place. FME then makes feature and attribute connections automatically. If either object has multiple input or output ports, you are prompted to choose which specific ports to connect. Make sure you turn on the Enable/Disable Drag and Insert Transformer feature. On the Workbench toolbar, click the tool . (If this tool does not appear on the toolbar: Right-click and select Customize Toolbar. Scroll to the tool and drag it onto the toolbar.) Safe Software Inc. 33 SettingupaWorkspace 4 Quick Connect Quick Connect is a fast way to connect different areas of a workspace simply by clicking the ports. This method is ideal for complex workspaces. Make sure to Enable Quick Connect in Tools > FME Options > Workbench. More Information For detailed information, see the Workbench help topic Transformers > Quick Connect. Drag the transformer over an existing link until the connection highlights in pink. Release the left mouse button and the transformer is placed and connected. Note that you may have to edit or check the transformer parameters before you can run the workspace. Click any port. An orange circle highlights the port and persists until you click outside of the port area or on another port. Click directly on the destination port and a link is created between the two ports. You can also connect one port to multiple ports. Click the first port and then press and hold the Ctrl key to complete multiple connections. 34 Getting Started with FME Desktop Setting up a Workspace Transformer Parameters Each transformer can contain a number of parameters. Access these parameters by either clicking the Properties button to the top right of each transformer, or by right-clicking a transformer and selecting Properties. Properties Button Colors The Properties button on a transformer is color-coded to show the status of the internal parameters. • Blue: The default transformer parameters have been checked and amended as required, and the transformer is ready to use. • Yellow: The default parameters have not yet been verified. The transformer can be used in this state, but the results may be unpredictable. • Red: There is at least one setting for which FME cannot supply a default value. The setting must be provided with a value before the transformer can be used. Transformer Colors Transformers are all color-coded. • All regular transformers are colored blue. • Custom transformers can be green (embedded custom transformer) or cyan (linked custom transformer). Custom transformers are described in detail in the Workbench Help files. • Some transformers, such as the Visualizer, have their own distinctive icon: Transformer Ports A transformer can have multiple input ports, multiple output ports, or both. Multiple Transformers You can connect a series of Workbench Transformers so that they have a cumulative effect on the data. Even though the Transformer Gallery contains hundreds of transformers, a single transformer may not meet all your requirements. In this situation, you need to use a combination of transformers. A string of transformers that graphically represents an overall workflow is a key concept of FME. Another key concept in FME is the ability to split data into separate processing streams within your workflow or to merge several streams into one. When a workspace becomes a complex series of parallel streams it is important that you test each stream separately, and also be aware of how changing one component can impact other sections further on in the workflow. Safe Software Inc. 35 SettingupaWorkspace 4 Custom Transformers A Custom Transformer allows you to create a single transformer to replace a sequence of transformers from an existing workspace. Custom transformers use the same data flow as the original transformers, and can be reused and edited just like any other transformer. Custom transformers can be used: • to streamline a large workspace • to make various data flows within a workspace more understandable and easier to document • as a replacement for the same chain of transformers multiple times within the same workspace You can also export a Custom Transformer. After they are exported, custom transformers can be: • edited independently of any workspace • shared with other users (through e-mail or shared directories) • embedded or linked in any number of workspaces • stored as a separate .fmx file More Information For detailed help see the Workbench help topic on Custom Transformers. Detailed Transformer Help For detailed information on all transformers, choose Workbench Help > FME Transformers. For help on individual transformers, you can also click the Transformer Description tab beneath the Log window. Transformers Reference Guide You can download a printable, quick-reference guide (in Adobe® PDF format) from http://www.safe.com/support/onlinelearning/documentation.php. Creating a Custom Format When you create a Custom Format, you can define your readers, your workflow, and the format's schema, and you can use it like a standard FME Source Format. This is useful if you consistently use the same information in a workspace, and when you consistently perform the same processing on datasets. More Information Select Workbench Help from the Help menu, and open the Custom Formats topic. 36 Getting Started with FME Desktop Setting up a Workspace Organizing the Workspace Using Bookmarks If you have a large workspace, it can be difficult to keep it organized. Bookmarks help you define sections of a workspace. Bookmarks are particularly useful when you’re working with large or detailed workspaces and you frequently refer to a certain area. Creating a Bookmark Click the bookmark tool in the toolbar or select Insert > Bookmark from the menu bar. Selecting an area of the workspace (for example, a transformer) before adding the bookmark ensures that the bookmark encloses the selected area. When the bookmark appears in the workspace, the text field in the bookmark is highlighted so you can enter a new name as soon as the bookmark appears. If the characters in your name exceed the width of the bookmark, the name is truncated. Bookmarks are also added under the Bookmarks folder in the Navigator: Double-click a bookmark to zoom to its location in the workspace or single-click to center the workspace on the selected bookmark. You can change a bookmark’s properties at any time. You can also export a bookmark to create a custom transformer. More Information Select Workbench Help from the Help menu, and open the Bookmarks topic, or open the Custom Transformers topic. Safe Software Inc. 37 SettingupaWorkspace 4 Creating Annotations Annotations are useful for documenting the purpose of a feature type, link, or transformer, especially in a large or complex workspace. Right-click a feature type or a transformer to select it and choose Attach Annotation from the command menu. Right-click a link or connection to select it and choose Add Annotation from the command menu. The default annotation anchors to the selected node. Double-click the annotation to edit the default text. Attaching Default Annotations to Multiple Objects The default annotation includes the name of the object. For feature type connections, it includes both the reader and writer information. Select multiple nodes or links, then right-click and choose Attach Annotation. Annotations are added to all objects and connections. Objects display the object name (feature type or transformer) as a default string, whereas connections show to as the default string. By default, annotations appear in front of the display and can overlay other parts of the workspace. To move annotations to the back of the display, rightclick an annotation and select Send to Back. This also works for feature types and transformers. 38 Getting Started with FME Desktop Setting up a Workspace Summary Annotations Select a feature type or transformer, right-click and choose Show Summary Annotation. An annotation bubble shows detailed information. This feature is useful when printing workspaces. Using the Feature Count Display The feature count display is an optional function, but it is one of the most useful testing and observation tools. It helps you analyze the results of a workspace and provides a reference for debugging if the destination data differs from what was expected. By default, the feature count display is turned off. Activate it by clicking the Display Feature Counts tool . If the tool is not shown on the toolbar, rightclick on the toolbar and select Customize Toolbar. Scroll to the tool and drag it onto the toolbar. When you use the Feature Count display, each connection is marked with the number of features that passed along it, as shown here: The feature counts above show that 2895 features passed through the transformer. The translation log confirms the number of features written. In the preceding example, all links show the same number. However, this would not be the case if you’re using transformers that affect the number of features (for example, the DuplicateRemover transformer), or if you have set up your workflow to have multiple processing streams. Safe Software Inc. 39 SettingupaWorkspace 4 Running the Translation There are three options for running a translation: No matter which option you choose, FME will begin the translation, and you’ll see information in the Log window. The amount of time the translation takes depends on different factors that may include the following: • the processing power of the FME host machine • the size of your data • the amount of processing that FME has to do Completing the Translation After you run the translation (and unless you have redirected output to a Visualizer), the output is written to location you specified in the Writer Dataset field. Running a Batch Translation The FME Workbench interface supports batch execution and batch script creation. For example, you can apply an existing workspace transformation to a large number of input files, and produce separate outputs for each. More Information For detailed information see Running a Batch Translation in the FME Workbench Help. Function Tool What it Does Run (or Resume) Runs the translation from start to finish, or resumes a translation after pausing. Prompt and Run Runs the translation and prompts you to enter selected parameters (for example, you may want to use different source data or change a transformer parameter). For details about this option, see Running a Workspace with Parameters in the FME Workbench help. Run with inspection Runs the translation using the Feature Inspector, after you define an inspection point. For details about this option, see Feature Inspector in the FME Workbench help. 40 Getting Started with FME Desktop Setting up a Workspace For More Information This chapter gives a high-level overview of Workbench functions – for detailed information, select Workbench Help from the Help menu, work through the FME Desktop Tutorial, download the Self-Study Modules, or register for a hands-on training course taught by accredited professionals. Safe Software Inc. 41 5 Chapter5Using FME Quick Translator Use an automated translation whenever you want to move data from a source system to the destination system quickly and with minimal effort. In most cases, an automated translation produces exactly the results you need. Specifying the Reader You can start the Quick Translator in the following ways. To start the Translator as a stand-alone application do one of the following: • From your desktop, click the Quick Translator shortcut . • From the Windows Start menu select All Programs > FME Desktop > FME Quick Translator. After you start the FME Quick Translator, locate the dataset that you want to translate. The dataset may be a directory, a file, or a group of files depending on the format you choose. Drag the source files onto the FME Quick Translator window – this is the easiest method because the source information is already specified. FME knows the format from the file extension. The Set Translation Parameters dialog opens, with all required fields populated. Click OK to start the translation. Note: Select Tools > Browse Readers and Writers to see a list of FME-supported formats and their file extensions. Enter any character string (including file extensions) in the Search field to show matching formats. 42 Getting Started with FME Desktop Using FME Quick Translator Merging Similar Datasets You can specify multiple datasets of the same format and with the same schema (data model). These datasets are merged together when you run the translation. 1 On the Set Translation Parameters dialog, at the Source location, in the Dataset field, click to open the Select Source Files dialog shown in the next figure. 2 You can type directly in the Folder field and use wildcards to include all files for a specific format. For example: C:\**\*.dgn merges all of the .dgn files on your C drive. You can also click Add Folder on the Select Source Files dialog to browse to a specific directory name, and check the Subfolders box to include all subfolders below that directory as well. All files that are in the specified format in those directories are included. Choose Add Files to select individual files. 3 Check the Identical Schemas box if you know that all files have the same schema. If you check this box, then FME does not perform an initial scan of all the files to determine their schemas. Instead, the first file is taken to be representative of the data model. 4 Click OK to accept these settings and close this dialog. The new datasets append to the original dataset name. When you run the translation, it merges the specified datasets. The Log shows detailed information during the translation. Reader Parameters Some formats contain Reader Parameters boxes, which allow you to specify additional parameters specific to the selected format. When you select one of these source formats, the Parameters button becomes available. Note that you don’t have to specify any parameters when your format supports this feature – FME simply uses default values. If the source format doesn’t support any special parameters, the button remains dimmed and unavailable. Note: For some formats, the dataset consists of an entire directory or even a database connection. Safe Software Inc. 43 UsingFMEQuickTranslator 5 More Information For detailed help on parameters boxes for specific formats, open a parameters box and press the F1 key or the Help button. Converting Coordinate Systems For systems that know their coordinate system (such as MapInfo and DLG), the Coordinate System field in the dialog shows “Read from Source”, which instructs FME to read the coordinate system from the source dataset. For most other input sources, the field shows “Unknown”, which means that FME uses default values. In most cases, the default value is all you need to perform the translation. If, however, you want to convert the coordinates of your data between a specific source and destination Coordinate System, you can either enter the name of the source and destination Coordinate Systems or choose them from the Coordinate System Gallery, shown here. Choosing from the Coordinate System Gallery Open the Coordinate System Gallery by clicking the Browse button next to the Coordinate System field. Select a coordinate system from the existing list and either click the Properties button to show detailed information or click OK to tell FME to use this coordinate system in the translation. To filter the list and show only the coordinate systems you want, use the menu selections at the bottom of the window. More Information For detailed help on coordinate systems and how to define custom coordinate systems, open the Coordinate System Gallery and press the F1 key. 44 Getting Started with FME Desktop Using FME Quick Translator Viewing the Reader Dataset To view the reader source dataset, click the Viewer button. More Information See Using FME Universal Viewer on page 49 or view the Universal Viewer help files. Entering Writer Information On the Set Translation Parameters dialog, enter or select the Writer Format and Dataset. The Writer Dataset name may be a directory or a file, and may also be the same as the Reader Dataset name. Writer Parameters Some formats contain Writer Parameters, which let you specify additional information specific to your selected format. When you select one of these formats, the Parameters button becomes available. Note that you don’t have to specify any parameters when your format supports this feature – FME uses the default values. If the destination format doesn’t support any special parameters, then the button remains dimmed and unavailable. More Information For detailed help on parameters boxes for specific formats, open a parameters box and press the F1 key or the Help button. Choosing a Mapping File Mapping files control how FME converts data from the selected Source Format to the selected Destination Format. The Mapping Files area on the Set Translation Parameters dialog (see page 41) shows only those mapping files that are relevant for the source and destination information you’ve entered. Choose a mapping file from the list. If you choose an automated mapping file, FME generates the file using the source and destination information you specified, and then deletes the file when the translation is complete. If you want to use a customized mapping file, then TIP You can also select a different reader to view, however, the reader information you specified does not change to reflect the new filename that you select. WARNING If you enter an existing filename, the existing file will be overwritten. Make sure you want to do this, because FME does not prompt you before overwriting the file. TIP To start the translation immediately, double-click the mapping file. Safe Software Inc. 45 UsingFMEQuickTranslator 5 FME reads the file from the location specified in the Mapping File Registry and uses that information to perform the translation. More Information You can read the topic Mapping File Syntax by selecting Help > FME Fundamentals Reference and then selecting Mapping File Syntax or by locating this document on your FME installation disk. Deciding on the Next Step Switching to FME Workbench After you choose your mapping file, you might want to refine your translation using FME Workbench. This means that you continue the translation using Workbench’s user interface – you get the same results, however, you can set up your translation in a graphical environment. Click the Workbench button to start FME Workbench. The New Workspace dialog opens, containing the source (Reader) and destination (Writer) information that you specified in the Set Translation Parameters dialog. By default, your workspace is named workspace.fmw. You can change the filename as long as you keep the .fmw extension. More Information See Setting up a Workspace on page 27 or select FME Workbench Help from the Help menu. Performing a Basic Translation If you’re performing a basic translation, and you don’t want to add any advanced functions, you can start the translation now following the instructions provided in Running the Translation on page 45. Running the Translation Start the translation by either double-clicking the mapping file you chose in Choosing a Mapping File on page 44, or by clicking OK in the Set Translation Parameters dialog. FME begins the translation and you can view the information in the Log. The amount of time the translation takes depends on different factors that may include the following: • the processing power of the FME host machine • the size of your dataset • the amount of processing that FME has to do Note: If there are no mapping files visible in this area, you have to create one and add it to the Mapping File Registry. 46 Getting Started with FME Desktop Using FME Quick Translator In most cases, however, a successful translation takes a few minutes at most, and the Log reads Translation was SUCCESSFUL. You can scroll back through the log to check specific statistics. Running a Batch Translation FME Quick Translator’s interface supports batch execution and batch script creation. For example, you can translate a large number of input files and produce separate outputs for each. You can run the batch translation immediately or save a batch script to be run later, potentially on another platform. For further information, open the FME Fundamentals help file and under the heading Running a Translation, look for Running a Batch Translation. Stopping a Translation The Stop button becomes available when you’re running a translation. Click it to immediately stop the translation. The Log view states Translation Stopped. When you stop a translation, any output file is left incomplete and is not usable. If you run the file again, the entire translation restarts, overwriting any partial results from a previously interrupted translation. Saving Log Text You may find it useful to save a text file of statistics or other processing information from a translation run. Save the logged text by using the Save button or by choosing Save As (Ctrl+S) from the File menu. Enter a filename in the dialog that opens and click the Save button. Copying and Searching Log Text Information To copy text and paste information to another location, select the text that you want to copy, click the Copy button , open a text editor, and click Paste or press Ctrl+V. You can also copy information by doing any of the following: • Select the Edit menu and choose Copy. • Press Ctrl+C. • Right-click the text you want to copy and choose Copy. To search for text, click the Search button . Type your search term in the dialog that appears, and click Find Next to begin the search function. Note: Sometimes stopping a translation causes FME to create temporary files that can take up unnecessary disk space. It’s a good idea to select Tools > Purge Temporary Files (or press Alt + C) after you stop a translation. Note: You cannot paste text into the Quick Translator log, however, you can paste it into another application, such as a text editor. Safe Software Inc. 47 UsingFMEQuickTranslator 5 Completing the Translation You have completed the steps involved in performing a translation using a default mapping file. The output from the translation is the output filename you specified in the beginning. Viewing the Output File View the output file with the FME Universal Viewer. If the Viewer isn’t already running, start it and open the output dataset. More Information See Using FME Universal Viewer on page 49, or start the FME Universal Viewer and click the Help menu. For More Information This chapter gives a high-level overview of Quick Translator functions – see the FME Quick Translator on-line help files for more detailed information. 48 Getting Started with FME Desktop Using FME Quick Translator Safe Software Inc. 49 6 Chapter6Using FME Universal Viewer The FME Universal Viewer, commonly called the Viewer, allows you to show a wide variety of GIS and CAD formats, examine features, identify attributes and values, and enhance the view using color, symbols, and labeling. Starting FME Universal Viewer You can start the Viewer in the following ways. To start the Viewer as a stand-alone application do one of the following: • From your desktop, click the Universal Viewer shortcut . • From the Windows Start menu select All Programs > FME > FME Universal Viewer. • Using Windows Explorer browse to your FME installation folder and click fmeview.exe. • Using Windows Explorer right-click a viewspace file (.fmv), or a supported GIS or CAD file, and open it using FME Universal Viewer. To start the Viewer from FME Workbench do one of the following: • Connect a Visualizer to a Transformer. When you run the translation, the Viewer is started, allowing you to check your data. • Click the Start the FME Universal Viewer tool on the toolbar. To start the Viewer from the FME Quick Translator do one of the following: • Press Alt+V. • Select Tools > Viewer. • Click the Start the FME Universal Viewer tool on the toolbar. • Click the Viewer button on the FME Set Translation Parameters dialog after you’ve selected the Reader Format and Dataset. 50 Getting Started with FME Desktop Using FME Universal Viewer FME Universal Viewer Interface FME Universal Viewer is a utility for viewing data in any FME-supported format. The Viewer is intended primarily for previewing data before translation or for verifying it after translation, but you can also check data at any point during a translation. It is closely tied to FME Workbench, which can send data directly to the Viewer. In addition to supporting its own viewspace file format (.fmv), the Viewer has basic translation abilities. Any data in the view can be saved to an output dataset in any FME-supported format by using the Save Data As function. Key to the elements on the Viewer Interface Each of these elements is described in the following sections. Menu Bar View Window Toolbar Information Window Display Control Window Log Window Tab Window Status Bar Safe Software Inc. 51 UsingFMEUniversalViewer 6 Using Viewer Tools Using Viewer Menus Many of the tool functions are also available through pull-down menus. In general, the File menu allows you to select commands that apply to the entire dataset, whereas the View menu allows you to customize the display. Right-clicking items in the Display Control Window, which shows a tree view, provides further options. Open a new dataset, add a dataset to the existing view, save as a different format, and close the view. Open a viewspace (.fmv file), save changes to a viewspace, or close the viewspace. Refresh the view (reloads the entire dataset). Repaint the existing view. Print the view that’s showing. Access feature information. Measure distances between two points in a view. See page 56. Choose from different zoom and pan functions. Enable mark location function and show location of marked area. See page 56. Show dynamic attributes. See page 57. Select all features that have no geometry. Filter features. See page 58. 52 Getting Started with FME Desktop Using FME Universal Viewer Adding a Dataset to the Viewspace Right-click the View number in the Display Control window at the top level of the tree view to add another dataset for viewing. The additional dataset name appears at the bottom of the tree view list, whereas the dataset appears in the viewspace window. Removing a Dataset from the Viewspace Right-click the dataset name in the tree view of the Display Control window and select Remove Dataset to remove the dataset. If you have only one dataset open, selecting this option closes it completely. Customizing Feature Types In the Display Control window, right-click the feature type names to customize their appearance through the Drawing Styles dialog shown here. Safe Software Inc. 53 UsingFMEUniversalViewer 6 Reordering Feature Types You can reorder feature types (themes) in the Viewspace through the Display Control window. For example, if you want a certain feature type to be drawn in the viewspace before all other feature types, you can move it to the top of the list. When you open a viewspace, the feature types initially appear in alphabetical order on the Display Control window in the tree view on the left-hand side of the Viewer. There are two ways to change the order: • To quickly move a feature type, click to select it and drag it up or down in the list. • If you want to change the order or display of many feature types, select the dataset name or the feature type name in the list, right-click it to show the command menu, where you select Reorder Feature Types. The Edit Feature Type Order dialog that opens lets you toggle the display of one or more feature types, as well as reorder them in the list or re-sort them alphabetically. 54 Getting Started with FME Desktop Using FME Universal Viewer Setting View Options Use the View > Options menu to select options which apply to the entire display. View multiple datasets within the same instance of the Universal Viewer by selecting Tab Window. Use the View > Windows menu to show and hide different areas of the Viewer. Safe Software Inc. 55 UsingFMEUniversalViewer 6 Showing the Information and Log Windows You can get detailed information on features in the dataset through additional windows and menu selections. The Log shows detailed information and statistics on the dataset. This area shows detailed information on features in the display. Right-click a coordinate pairing and select Mark Location to flag a location on the display. See Marking a Location on a Dataset. 56 Getting Started with FME Desktop Using FME Universal Viewer Performing Additional Tasks Marking a Location on a Dataset The Mark Location feature allows you to pinpoint a location on a dataset. Rightclick any part of the dataset and select Mark Location. Measuring Distances Use the measuring tool to determine distances between two points in a view. One of the advantages of this tool is that it allows you to determine how close things are so that you can set and adjust tolerances during FME format transformations. Place the cursor anywhere in the dataset, right-click, and select Mark Location from the command menu. The location is marked with a red crosshair. Select this tool to show the xy coordinates of the mark. Specify a radius for the marker, in units. Zoom immediately to the marked location. If you plan on closing your viewspace, make sure you save it first – this also saves your marked location. Drag the crosshair from point A and drop it at point B. A red line appears between the two points. Select the measuring tool. The cursor turns into a crosshair in the viewspace. The Log window shows the distance measured, as well as start and end coordinates. If you don't have your Log window open, you can still see this information in the status bar. Safe Software Inc. 57 UsingFMEUniversalViewer 6 Showing Dynamic Attributes Dynamic Attributes let you add new attributes to your data, including any FME functions. For example, to add an @Length attribute, follow the steps shown in the next figure. The new attribute appears in the list in the Information Window. If you don’t have this window showing, select Information Window from the View > Windows menu. Type the new attribute name and expression, remembering to include any parameters in parentheses. Click Add to add the attribute to the list. Close the window. The new attribute is added to the list. 58 Getting Started with FME Desktop Using FME Universal Viewer Filtering Features To limit the features that are shown, click the Filter Features tool to open the Filter Features dialog (shown below) where you apply an FME-style filter. Only features that pass the filter are shown. Two examples are shown here: For More Information This chapter gives a high-level overview of Viewer functions – see the FME Universal Viewer Help files for detailed information. Left Side is often expressed as an FME function or attribute reference. Right Side is usually expressed as a constant. This filtering example expresses how to show all features with a width attribute value of less than 100.