Getting Started

Get the Source and Build the Binaries

This is described in the build documentation.

The FDO installation path on Linux is fixed. It is /usr/local/fdo-<version>.

The FDO installation path on Windows is configurable using a command-line argument to the build script.

Setup the C++ Application Development Environment

Check out the settings in the solution (.sln) and project (.vcproj) files found in the FDO source folders on Windows and in the makefile.am and configure.in files found in the FDO source directories on Linux.

Windows

The assumption is that you are using Visual Studio Express, Standard or Professional 2005.

Use the installation path to set up the environment so that headers and libraries can be located at compile time, and shared objects can be located at runtime.

Use the build path to set up the environment so that the debugger can locate program database files (symbol tables) and source files at runtime.

You can make the various files visible by either setting solution or project properties or by setting Visual Studio tool options or by setting an environment variable (PATH).

The first step for the properties method is to select the solution or project in the Solution Explorer, right-click to its pop-up menu and select Properties. The result is that the properties dialog is displayed. If the project properties dialog is displayed, the second step is to expand 'Configuration Properties' in the properties dialog contents pane.

The first step for the tool options method is to select 'Options...' from the Tools menu in the main menubar. The result is that the options dialog is displayed.

Headers

In the project properties dialog contents pane expand 'Configuration Properties' and then 'C/C++'. Select 'General' and edit 'Additional Include Directories'.

Alternatively, in the options dialog contents pane expand 'Projects and Solutions' and then 'VC++ Directories'. Select 'Include files' from the spinbox labeled 'Show directories for:'. Follow the procedure for adding a directory.

Libraries

In the project properties dialog contents pane expand 'Configuration Properties' and then 'Linker'. Select 'General' and edit 'Additional Library Directories'.

Alternatively, in the options dialog contents pane expand 'Projects and Solutions' and then 'VC++ Directories'. Select 'Library files' from the spinbox labeled 'Show directories for:'. Follow the procedure for adding a directory.

Dynamically Linked Libraries

In the options dialog contents pane expand 'Projects and Solutions' and then 'VC++ Directories'. Select 'Executables' from the spinbox labeled 'Show directories for:'. Follow the procedure for adding a directory.

Or use XP to set the PATH environment variable to reference the location of the DLLs.

Source Files

In the solution properties dialog contents pane expand 'Common Properties'. Select 'Debug Source Files'. Follow the procedure for adding a directory.

In the options dialog contents pane expand 'Projects and Solutions' and then 'VC++ Directories'. Select 'Source files' from the spinbox labeled 'Show directories for:'. Follow the procedure for adding a directory.

Symbol Table Files (Program Database Files)

In the options dialog contents pane expand 'Debugging' and then 'Symbols'. Follow the procedure for adding a directory.

Linux

Set LD_LIBRARY_PATH.

Setup the C++ Application Development Environment

To be done.

Access the API Reference Documentation

The API reference documentation has been created by using doxygen to process comments in the header files. When doxygen generates the html files, it distributes them across a generated file structure to allow for quicker access. This prevents direct linking to the class html files.

When you are asked to read FDO C++ class reference documentation, load the FDO C++ API Reference, click the Classes tab in the right-hand pane and click on the class name.

When you are asked to read FDO C# class reference documentation, load the FDO .NET API Reference, click the Classes tab in the right-hand pane and click on the class name.

Write the Code to Connect to a Provider

Do the following:

  1. Get the list of installed providers
  2. Create a connection manager
  3. Create a connection
  4. Get the connection state
  5. Get the connection properties
  6. Get values for the connection properties
  7. Set the connection properties
  8. Open a connection
  9. Open a pending connection

Create a Provider Registry

The provider registry tells you what providers are installed.

Read about the GetProviderRegistry method in the FdoFeatureAccessManager C++ class reference or the FeatureAccessManager C# class reference.

Get the List of Installed Providers

Read about the GetProviders method in the FdoProviderRegistry C++ class reference or the ProviderRegistry C# class reference. This method returns the contents of the providers.xml file found in the <install>/bin folder on Windows and in the /usr/local/fdo-<version>/lib directory on Linux.

When you create the connection, you will use one of the strings returned by this method as an argument.

Create a Connection Manager

The connection manager creates connections.

Read about the GetConnectionManager method in the FdoFeatureAccessManager C++ class reference or the FeatureAccessManager C# class reference.

Create a Connection

Read about the CreateConnection method in the FdoConnectionManager C++ class reference or the IConnectionManagerImp C# class reference.

Get the Connection State

At this point the state of the connection is closed.

Read about the GetConnectionState method in the FdoIConnection C++ class reference or the IConnectionImp C# class reference.

Get the Connection Properties

First you get the connection information. Read about the GetConnectionInfo method in the FdoIConnection C++ class reference or the IConnectionImp C# class reference.

Then you get the connection properties. Read about the GetConnectionProperties method in the FdoIConnectionInfo C++ class reference or the IConnectionInfoImp C# class reference. This method returns a connection property dictionary.

Read about the methods used to access the information in the connection properties dictionary in the FdoIConnectionPropertyDictionary C++ class reference or the IConnectionPropertyDictionary C# class reference. Using these methods you can find out the names of the properties, whether they are optional or mandatory, whether they have default values, their type, whether they are enumerable and, if enumerable, what the set of enumerated values is.

Get Values for the Connection Properties

The types of properties used in connections include:

  • user names
  • passwords
  • file path names
  • URLs
  • symbolic host names
  • service identifiers
  • data store names

Each provider has its own unique set of connection properties. The connection properties for the various providers are described in The Essential FDO (PDF).

Set the Connection Properties

Read about the methods used to access the information in the connection properties dictionary in the FdoIConnectionPropertyDictionary C++ class reference or the IConnectionPropertyDictionary C# class reference.

Open a Connection

Read about the Open method in the FdoIConnection C++ class reference or the IConnectionImp C# class reference.

Open a Pending Connection

Each of the RDBMS-based providers has a connection property, which is there to contain the name of a data store. The data store property is initially not required in order to make a connection. If the property is not set, then the resulting connection, if successful, is in a pending state.

As a result of the initial connection operation, the data store property is populated with the names of the data stores in the RDBMS, and its optionality attribute is changed to a value of required.

Use the EnumeratePropertyValues method on the FdoIConnectionPropertyDictionary (C++) object or the IConnectionPropertyDictionary (C#) object to read the set of data store names and set the data store property in the dictionary object to one of those names. Then call the Open method on the FdoIConnection (C++) object or the IConnectionImp (C#) object again. This will result in a fully open connection.

You can connect to an ArcSDE provider using a pending connection, you will find that there is only ever one name in the set of data store names returned as a result of the initial connection.

Next Steps

ArcSDE Provider

You use this provider to connect to an ArcSDE server, which is, in turn, connected to an Oracle or SQL Server data source.

The next step is to determine the number and composition of feature schema in the data store so that you can execute data maintenance (insert, update, and delete) and query (select) commands.

MySQL Provider

The next steps are to create a data store and a user, and after that, create a feature schema and execute data maintenance and query commands.

SDF, SHP and ODBC Providers

The next steps are to create a feature schema and execute data maintenance and query commands.

WFS and WMS Providers

The next steps are to determine the composition of the feature schema and execute query commands.