The Map Suite FDO Extension illustrated QuickStart Guide will walk you through the process of using the new Map Suite Feature Data Objects (FDO) extension, which enables you to work with a great many more data file formats, both raster and vector. The FDO extension is included with Map Suite Desktop Edition 3.0.307 and higher, and Map Suite Web and Services Editions 3.1.124 and higher.
Disclaimer: Because the FDO extension is based on a third-party open-source code library, you may experience unexpected issues beyond ThinkGeo's control when using an FDO-supported data format.
Download Sample Code From This Exercise
We are very pleased to announce that in the latest versions of Map Suite Desktop Edition, Web Edition and Services Edition, with the help of FDO (Feature Data Objects), we now support a vast array of new data formats!
You already know that Map Suite supports these popular data formats right out of the box:
Vector Formats
Raster Formats
- ShapeFile
- SQL 2008
- Oracle Spatial
- PostgreSQL PostGIS (via extension)
- Mr. Sid
- ECW
- JPEG 2000
- BMP
- TIFF
- GeoTIFF
Now, with the FDO extension, you'll also have access to more than 20 new vector formats and more than 70 new raster formats, making it even easier to start using Map Suite with the data you have at your disposal.
Getting Started with FDO
To start using the FDO extension that's included with Map Suite, simply copy the folder [InstallPath]\Developer Reference\System32\MapSuiteFdoExtensionx86 to C:\Windows\System32, reference the FdoExtension.dll assembly under [InstallPath]\Developer Reference\Spatial Extensions\Fdo Extension and you'll have instant access to all of the new data formats.
Note for 64-Bit OS Users: FdoExtension.dll only works with x86 environments for now.
What's inside the FdoExtension.dll
After referencing FdoExtension.dll, there are 5 new Feature Layers we can use:
- CommonFdoFeatureLayer
- OgrFeatureLayer
- PersonalGeoDatabaseFeatureLayer
- SdfFeatureLayer
- TabFeatureLayer
PersonalGeoDatabaseFeatureLayer supports ESRI Personal Geodatabase (.mdb).
SdfFeatureLayer supports Spatial Data File (.sdf).
TabFeatureLayer supports MapInfo Tab file (.tab).
OgrFeatureLayer supports all the formats in the following list (see here for more details):
CommonFdoFeatureLayer is a superset of all the above feature layers. It supports all of the types that the above layers support. The difference is that OgrFeatureLayer deals with Data Files, while CommonFdoFeatureLayer works like a database. That's why you need to input a connection string in the constructor of CommonFdoFeatureLayer.
After referencing FdoExtension.dll, there are also 2 new Raster Layers we can use:
- CommonFdoRasterLayer
- GdalRasterLayer
GdalRasterLayer supports all the following types (see here for more details):
CommonFdoRasterLayer supports all the feature types that GdalRasterLayer supports. The difference is that GdalRasterLayer deals with Data Files, while CommonFdoRasterLayer works like a database. That's why you need to input a connection string in the constructor of CommonFdoRasterLayer.
How to Use FdoExtension for New Data Types
Let's take the MapInfo TAB format as an example. After copying the MapSuiteFdoExtensionx86 folder to C:\Windows\System32 and referencing FdoExtension.dll, you can use the TabFeatureLayer class to load, display and operate on the TAB data. TabFeatureLayer is inherited from FeatureLayer, and has the same methods/operations as other FeatureLayers in the system. Please have a look at the sample application (Extending MapSuite->TabFileFeatureLayer) that comes with the product. For a more in-depth walkthrough, here are the step-by-step instructions on how to use FdoExtension with Map Suite Desktop Edition.
Note: For the purposes of this guide, let's assume we have installed Map Suite Desktop Edition 3.0 to the default folder C:\Program Files\ThinkGeo\ Map Suite Desktop Full Edition 3.0 (BETA)\. It should be very similar for Web and Services Editions.
Setting Up the Environment
Let's start with a new Windows Forms project in the Visual Studio.NET 2008 IDE and call it HelloFdo (see Figure 1). We can create the project with .NET Framework 3.5, 3.0 or 2.0.

Figure 1. Creating a new project in the Visual Studio.NET 2008 IDE.
Next, we need to put a Map control on the Form. The Map control is located in the Toolbox under Windows Forms (see Figure 2). If you do not see these controls, you will need to add them to your Toolbox manually.
Adding the Map Controls to the Visual Studio.NET IDE Toolbar
1. When you first open the Visual Studio.NET IDE after installing Map Suite, you may not see the controls in the Toolbox. You will need to follow these steps to add the controls.
Hover over the Toolbox and right-click anywhere on list of controls. You will get a pop-up menu. Select "Choose Items...".

2. The "Choose Toolbox Items" dialogue box will appear. You will need to select the .NET Framework Components tab and then click the Browse button. Finally, navigate to the C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Developer Reference\DesktopEdition folder and select the DesktopEdition.dll.

3. You should now have the Map control available in your Toolbox as shown in Figure 2 below.

Figure 2. The Map controls in the Toolbox window.
Adding the Map Control to your Windows Form
We need to add MapSuiteCore.dll and FdoExtension.dll to the reference. Right-click the project in Solution Explorer and select "Add Reference..." Navigate to the C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Developer Reference\DesktopEdition folder and select MapSuiteCore.dll, and then navigate to the C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Developer Reference\Spatial Extensions\Fdo Extension folder and select FdoExtension.dll.

Draw the Map control on the form by clicking on the Map control object in the Toolbox and then dragging and dropping (using the left mouse button) to the size you desire. You can leave the name of the Map control as winformsMap1. Our map will display in this control.

Copy the folder C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Developer Reference\System32\MapSuiteFdoExtensionx86 to C:\Windows\System32. (see Figure 3)

Figure 3. Copy the MapSuiteFdoExtensionx86 folder to C:\Windows\System32.
Now that we have copied the MapSuiteFdoExtensionx86 folder to C:\Windows\System32, referenced the MapSuiteCore.dll and FdoExtension.dll, and added a Map Control, we are ready to add the code to our application.
Map Suite Desktop "Hello Fdo" Sample
In creating our "Hello Fdo" sample application, our first step is to set references to the Map Suite Core and Map Suite DesktopEdition workspaces at the very top of our code, as we will use many classes within those workspaces. We do this so that we do not have to use the fully qualified names of the Map Suite classes throughout our code. Setting a reference to the Map Suite workspace can be done in the "code-behind" of the Form by selecting the Form and hitting the F7 function key. Set the reference like this:
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.DesktopEdition;
This sample will show you how to draw a map with the MapControl using your own TAB data. At the very beginning, let's have a look at the data we will use. (See Figure 4)

Figure 4. HoustonMuniBdySamp_Boundary.TAB, the data we will use in this sample.
private void Form1_Load(object sender, EventArgs e)
{
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.CurrentExtent = new RectangleShape(-96.51477, 30.759543, -94.355788, 28.910652);
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
// Create a TabFile Feature Layer.
// FID: ID Column Name
// OGRSchema: Feature Schema Name. For most cases in Tab, it's "OGRSchema"
// HoustonMuniBdySamp_Boundary: Feature Class Name. For most cases in Tab, it's the File Name
// GEOMETRY: Geometry Column Name.
// TabFileFeatureLayer worldLayer = new TabFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Samples\SampleData\Data\HoustonMuniBdySamp_Boundary.TAB", "FID", "OGRSchema", "HoustonMuniBdySamp_Boundary", "GEOMETRY");
// Above is a common constructor of Fdo Feature Layer, Specific for Tab File, you can use the following simpler one for most of cases.
// It will use "OGRSchema" as the Schema Name, use "HoustonMuniBdySamp_Boundary" as the Class Name,
// and use the name of the first Geometry Column if found as the Geometry Column Name
TabFileFeatureLayer worldLayer = new TabFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Samples\SampleData\Data\HoustonMuniBdySamp_Boundary.TAB", "FID");
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
// Add the TabFile Feature Layer to a Layer Overlay.
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add("WorldLayer", worldLayer);
winformsMap1.Overlays.Add(staticOverlay);
// Draw the map.
winformsMap1.Refresh();
}
If you compile and run what you have now, your map should look like the one below. (See Figure 5)

Figure 5. The map from HoustonMuniBdySamp_Boundary.TAB.
Navigate the Map
With the above code, not only can you display a map, but you can also navigate it. You can pan by dragging the map, zoom in by double-clicking, zoom out by double-right-clicking, track zoom in by drawing a rectangle with your left mouse button while holding the shift key, or zoom in and out by using the mouse wheel. Very powerful for just a couple lines of code, isn't it?
If you have any questions or want to leave feedback for us, feel free to post your comments below, or in the 3.x Support Forums for the product you're working with — be it Desktop Edition, Web Edition or Services Edition. You can also contact us using one of the methods below:
Pre-Sales & Customer Support:
ThinkGeo Customer Portal
Support Phone:
1-866-847-7510
1-785-727-4133 (Outside North America)
Web Site:
http://thinkgeo.com
Download Sample Code From This Exercise