User Tools

Site Tools


map_suite_spatial_data_extension_quick_start_guide

Map Suite Spatial Data Extension Quick Start Guide

The Map Suite Spatial Data Extension has been discontinued.

The Map Suite Spatial Data Extension QuickStart Guide will guide you through the process of creating a simple spatially aware application using the ArcSDE® data service and help you become familiar with the Map Suite Spatial Data Extension. Please note that you will need to install ArcGIS Server version 9.3 from ESRI® as there are some binaries included that the Map Suite Spatial Data Extension relies upon.

Welcome to Map Suite™ from ThinkGeo, a full featured mapping control that makes it easy for any Microsoft .NET developer to add mapping functionality to a Microsoft .NET application quickly and efficiently. Using the intuitive object model, even developers inexperienced in Geographic Information Systems (GIS) can have fully functional maps working in minutes.

This QuickStart will guide you through the process of creating a simple spatially aware application using the ArcSDE® data service and help you become familiar with the Map Suite Spatial Data Extension. Like any new software, there is some learning to be done.

NOTE: The beta version of the Spatial Data Extension is intended for testing and is currently supplied as an Evaluation Edition that will expire 60 days after installation.

Brief Introduction

ArcSDE Introduction

ArcSDE (Spatial Database Engine) is server software produced by ESRI® that spatially enables a Relational Database Management System, and the spatial data may be used as part of a Geodatabase. Currently the Map Suite Spatial Data Extension only supports ArcSDE 9.3 and only works on 32-bit operating systems (it does not support 64-bit Windows).

What Key Assemblies are Included in the Extension?

a. MapSuiteSpatialDataExtension.dll, located in the installation folder

b. MapSuiteSpatialDataExtension folder (located in the Windows\system32 folder), containing the following files:

  1. ArcSDEMessage.dll
  2. ArcSDEProvider.dll
  3. ArcSDEProvider92.dll
  4. boost_date_time-vc90-mt-1_34_1.dll
  5. boost_thread-vc90-mt-1_34_1.dll
  6. ExpressionEngine.dll
  7. FDO.dll
  8. FDOCommon.dll
  9. FDOGeometry.dll
  10. FDOMessage.dll
  11. FDOSpatial.dll
  12. OSGeo.FDO.Common.dll
  13. OSGeo.FDO.dll
  14. OSGeo.FDO.Geometry.dll
  15. OSGeo.FDO.Spatial.dll
  16. OWS.dll
  17. SpatialDataExtension.dll
  18. Xalan-C_1_7_0.dll
  19. XalanMessages_1_7_0.dll
  20. xerces-c_2_5_0.dll
  21. providers.xml
  22. pe.dll (This file needs to be copied from your ArcSDE Server 9.3 installation folder.)
  23. sde.dll (This file needs to be copied from your ArcSDE Server 9.3 installation folder.)
  24. sg.dll (This file needs to be copied from your ArcSDE Server 9.3 installation folder.)

What Are the Assemblies and Where Are They From?

Three files (“pe.dll”, “sde.dll”, and “sg.dll”) are found in your ArcSDE Server 9.3 installation folder. The rest of the files are from FDO 3.4.1 RC2 (http://fdo.osgeo.org/content/fdo-341-downloads). The following files have been modified by ThinkGeo:

  • ArcSDEMessage.dll
  • ArcSDEProvider92.dll
  • FDO.dll
  • FDOCommon.dll
  • FDOGeometry.dll
  • FDOMessage.dll
  • FDOSpatial.dll
  • OSGeo.FDO.Common.dll
  • OSGeo.FDO.dll
  • OSGeo.FDO.Geometry.dll
  • OSGeo.FDO.Spatial.dll

If you would like to request the source code that includes the changes ThinkGeo has made to FDO, please contact us.

Setting Up the Environment

Let's start with a new Windows Forms project in the Visual Studio.NET 2008 IDE. You can choose .NET Framework 4.5, 4.0, 3.5, 3.0 or 2.0. Three additional steps also need to be performed as described below:

  1. Make sure Map Suite Services Edition, Desktop Edition, Web Edition or Silverlight Edition is installed, either an evaluation or full version. We will automatically install Map Suite Desktop Evaluation Edition for you during the installation of the Spatial Data Extension.
  2. Make sure that the folder MapSuiteSpatialDataExtension exists in your Windows operating system's system32 folder. It will automatically be created during the installation of the Spatial Data Extension.
  3. Copy “pe.dll”, “sde.dll”, and “sg.dll” from your ArcSDE Server 9.3 installation folder to your Windows operating system's system32\MapSuiteSpatialDataExtension folder.

Note: If you are using the Map Suite Spatial Data Extension version 7.0.0.0 or later, you also need to add “WindowsBase.dll” to the references. WindowsBase can be found on the .NET tab of the Add Reference dialog. If you don't do this, you will get the following error when you compile the project:

“The type 'System.Collections.Specialized.INotifyCollectionChanged' is defined in an assembly that is not referenced. You must add a reference to assembly 'WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.”

Map Suite Spatial Data Extension "Hello World" Sample

(Note: We are using Map Suite Services Edition for the purposes of this example. If you have installed a different edition of Map Suite, the steps here will be similar.)

 1. How to display a map using ArcSDE data:
  a. Add the “MapSuiteSpatialDataExtension.dll” reference to your project.
  b. Add the following code:

  private void Sample_Load(object sender, EventArgs e)
    {
        string serverIP = "192.168.0.165";
        string port = "5151";
        string username = "username";            
        string password = "password";
        string datastore = "master";           // Case-Sensitive.
        string idColumnName = "OBJECTID";      // Case-Sensitive.
        string schemaName = "master_dbo";      // Case-Sensitive.
        string featureClassName = "Tablename"; // Case-Sensitive.
        string geometryColumnName = "Shape";   // Case-Sensitive.
        ArcSdeFeatureLayer layer = new ArcSdeFeatureLayer(serverIP, port, username, password, datastore, idColumnName, schemaName, featureClassName, geometryColumnName);
        layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
        layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
 
        MapEngine engine = new MapEngine();        
        engine.CurrentExtent = new RectangleShape(-180, 90, 180, -90);
        engine.StaticLayers.Add(layer);    
        RefreshMap(engine);
    }
 
    private void RefreshMap(MapEngine engine)
    {
        Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
        engine.OpenAllLayers();
        engine.DrawStaticLayers(bmp, GeographyUnit.DecimalDegree);
        pictureBox1.Image = bmp;
        engine.CloseAllLayers();
    }

Notes:

If you don't know the proper values of the SchemaName and FeatureClassName parameters, then you can set them to String.Empty and use some special functions to list the available SchemaNames and FeatureClassNames. For SchemaName, use the layer.GetFeatureSchemaNames(); function to get a schema name list, from which you can choose a SchemaName. For FeatureClassName, use layer.GetFeatureClassNamesBySchema(string featureSchemaName) to get a feature class name list, from which you can choose a FeatureClassName. After performing these two steps, change the SchemaName and FeatureClassName parameters to the actual values.

 2. How to perform the ExecuteQuery operation for ArcSDE Server:
  a. Complete the same steps as shown in the “How to display a map using ArcSDE data” section above.
  b. Use layer.Open(); to open the layer.
  c. Use layer.QueryTools.ExecuteQuery(string sqlStatement); to perform the execute query operation for ArcSDE Server.

 3. Because many properties for an ArcSDE Server are case sensitive, please be careful and always ensure that you are using the proper case. Issues with incorrect case are the most common cause of errors.

map_suite_spatial_data_extension_quick_start_guide.txt · Last modified: 2015/09/16 09:46 by admin