Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Home  |  Cygnus Track  |   Code Community

Discussion Forums

The online community for users of Map Suite GIS components

RSS Feed Available AddThis - Bookmarking and Sharing Button Printer Friendly

PrevPrev NextNext

Map Suite Spatial Data Extension QuickStart Guide

Posted by ThinkGeo on 12-30-2009 01:04 PM

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

1. 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).

2. What Key Assemblies are Included in the Map Suite Spatial Data Extension?

  1. MapSuiteSpatialDataExtension.dll, located in the installation folder
  2. 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.)

3. 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 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.

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:
    1. Add the "MapSuiteSpatialDataExtension.dll" reference to your project.
    2. 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.

  1. How to perform the ExecuteQuery operation for ArcSDE Server:
    1. Complete the same steps as shown in the "How to display a map using ArcSDE data" section above.
    2. Use layer.Open(); to open the layer.
    3. Use layer.QueryTools.ExecuteQuery(string sqlStatement); to perform the execute query operation for ArcSDE Server.
  2. 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.

Summary

If you have questions on anything covered in this QuickStart guide, the ThinkGeo Support Team is ready and available to help. If we can be of any assistance, please contact us using the below information:

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

0 Comments

You are not authorized to post a reply.
Active Forums 4.1