ThinkGeo.com    |     Documentation    |     Premium Support

Oracle dependencies cannot be found

I am trying to do a very basic connection to an Oracle spatial database to get the a layer using MVC. This is the code that I have on my view:



@{Html.ThinkGeo().Map(“Map1”, new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage), 510)
      .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)))
      .MapUnit(GeographyUnit.DecimalDegree)
      .StaticOverlay(overlay =>
      {
          string connectString = “User ID=pimsdb;Password=pimsdb;Data Source=GIS;”;
          OracleFeatureLayer oracleLayer = new OracleFeatureLayer(connectString, “PROPERTIES_SA”, “GEOLinstall merge moduleOC”);
          oracleLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
          oracleLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



          overlay.Layer(oracleLayer);
      }).Render();}


When I run the page, I get the following error:

An exception of type ‘System.ArgumentException’ occurred in MapSuiteCore.dll but was not handled in user code



Additional information: Oracle dependencies cannot be found.



There is something on the forums about MapSuiteOracleDependenciesX86.msm - wiki.thinkgeo.com/wiki/Map_Suite_MVC_Edition_Deployment_Guide, but I don’t really know what to do with a .MSM file. Do I need to install it? How do I do that?



Regards,

Paul

I have now switched over to the WebAPI edition, and I am getting the same error with the following code:



try
            {
                var TNS =
                "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=STOSVR)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=EBFD)))";
                var connectionStr = "User Id=xxxx; Password=xxxx; Data Source=" + TNS + "; pooling=true";
                OracleFeatureLayer layerFields = new OracleFeatureLayer(connectionStr, "fields", "GEOLOC");
                layerOverlay.Layers.Add(layerFields);
            }
            catch (Exception exc)
            {
                string s = exc.Message;
            }



exc = {"Oracle dependencies cannot be found."}



I would prefer to use the WebAPI method. What am I doing wrong here?

Paul,  
  
 Oracle dependencies are need, which can be downloaded here:  
 wiki.thinkgeo.com/wiki/File:MapSuiteOracleDependencies8.0.280.0.zip 
  
 Just double click the downloaded MSI and it would do all the jobs for you. OracleFeatureLayer is then good to go.  
  
 Behind he scenes, that MSI installs dependencies dlls under C:\Windows\SysWOW64\Map Suite 8.0, both Map Suite 8 and Map Suite 9 can load those dependencies without issues.  
  
 MSM is a merge module file, which is used when packaging those dlls in an installer. You don’t need to worry about it now.  
  
 Good luck with your project and let us know if you need more help.  
  
 Ben 
  
  


Thanks for the quick response. That has gotten me a bit further, but not a great deal. I am now successfully getting feature layers, but none of the feature layers are showing up on the map. This is my HTML page:






    Draw edit features
    
    
    
    
    
    
    
    
    
    


    
    
    
        
    
    <script src=“Scripts/jquery-1.11.1.min.js”></script>
    <script src=“Scripts/leaflet.js”></script>
    <script src=“Scripts/leaflet.draw.js”></script>
    <script src=“thinkgeo.leaflet.js”></script>
    <script>
        var accessId = guid();
        var drawingLayer, editServerShapes = false;
        var editingData = { removedIds: [], newShapes: [] };



        // Create the leaflet map.
        var map = L.map(‘map’, {
            center: [-28.057874, 140.182468],
            zoom: 14
        });



        // Added WorldMapKit Online as the background map. 
        L.tileLayer.wms("{s}.thinkgeo.com/CachedWMSServer/WmsServer.axd", {
            subdomains: [‘worldmapkit1’, ‘worldmapkit2’, ‘worldmapkit3’, ‘worldmapkit4’, ‘worldmapkit5’, ‘worldmapkit6’],
            layers: ‘OSMWorldMapKitLayer’,
            format: ‘image/png’,
            styles: ‘WorldMapKitDefaultStyle’,
            version: ‘1.1.1’,
            attribution: ‘ThinkGeo | &copy; OpenStreetMap contributors ’
        }).addTo(map);



        // Add the layer to the map to render the shapes which we will be editing.
        var shapeLayer = L.tileLayer(getRootPath() + “/edit/{z}/{x}/{y}/” + accessId);
        shapeLayer.on(‘loading’, function () {
            $(’#loadingImage’).show();
        })
        shapeLayer.on(‘load’, function () {
            $(’#loadingImage’).hide();
        })
        shapeLayer.addTo(map);



        // Add a utility method to get root path. 
        function getRootPath() {
            var pathArray = location.pathname.split(’/’);
            var appPath = “/”;
            for (var i = 1; i < pathArray.length - 1; i++) {
                appPath += pathArray + “/”;
            }



            return appPath === “/” ? “” : appPath;
        };



        // Add a utility methods to get guid. 
        function guid() {
            function s4() {
                return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
            }
            return s4() + s4() + ‘-’ + s4() + ‘-’ + s4() + ‘-’ + s4() + ‘-’ + s4() + s4() + s4();
        };
    </script>





While this is my controller:



[Route("{z}/{x}/{y}/{accessId}")]
        public HttpResponseMessage GetTile(int z, int x, int y, string accessId)
        {
            // Create the layerOverlay for displaying the map.
            LayerOverlay layerOverlay = new LayerOverlay();
            
            try
            {
                var connectionString = “User Id=xxxx; Password=xxxx; Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.223)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=EBFD)));”;
                
                OracleFeatureLayer FieldLayer = new OracleFeatureLayer(connectionString, “FIELDS”, “MI_PRINX”);
                FieldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = WorldMapKitAreaStyles.Orchard();
                FieldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



                OracleFeatureLayer OilPipelineLayer = new OracleFeatureLayer(connectionString, “PIPELINES”, “PIPELINE_ID”);
                OilPipelineLayer.WhereClause = “WHERE UPPER(FLUID_TYPE) LIKE ‘%OIL%’”;
                OilPipelineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = WorldMapKitLineStyles.MinorRoadOutline(1.0f);
                OilPipelineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen.Color = GeoColors.Green;
                OilPipelineLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



                OracleFeatureLayer GasPipelineLayer = new OracleFeatureLayer(connectionString, “PIPELINES”, “PIPELINE_ID”);
                GasPipelineLayer.WhereClause = “WHERE UPPER(FLUID_TYPE)=‘GAS’”;
                GasPipelineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = WorldMapKitLineStyles.MinorRoadOutline(1.0f);
                GasPipelineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen.Color = GeoColors.Red;
                GasPipelineLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



                OracleFeatureLayer WaterPipelineLayer = new OracleFeatureLayer(connectionString, “PIPELINES”, “PIPELINE_ID”);
                WaterPipelineLayer.WhereClause = “WHERE UPPER(FLUID_TYPE) LIKE ‘%WATER%’”;
                WaterPipelineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = WorldMapKitLineStyles.MinorRoadOutline(1.0f);
                WaterPipelineLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen.Color = GeoColors.Blue;
                WaterPipelineLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



                OracleFeatureLayer TenementsLayer = new OracleFeatureLayer(connectionString, “TENEMENTS_AUSTRALIA”, “MI_PRINX”);
                TenementsLayer.WhereClause = “WHERE RETIRED_DATE IS NULL”;
                TenementsLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = new AreaStyle(GeoPens.Red);
                TenementsLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Width = 0.2f;
                TenementsLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.Color = GeoColors.LightGray;
                TenementsLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle.OutlinePen.DashStyle = LineDashStyle.Dot;
                TenementsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



                OracleFeatureLayer Seis3DLayer = new OracleFeatureLayer(connectionString, “PETROSYS_SEIS_3D”, “SSU_GEOMS_UID”);
                Seis3DLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = WorldMapKitLineStyles.MinorRoadOutline(1.0f);
                Seis3DLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle.OuterPen.Color = GeoColors.OrangeRed;
                Seis3DLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;



                layerOverlay.Layers.Add(FieldLayer);
                layerOverlay.Layers.Add(OilPipelineLayer);
                layerOverlay.Layers.Add(GasPipelineLayer);
                layerOverlay.Layers.Add(WaterPipelineLayer);
                layerOverlay.Layers.Add(TenementsLayer);
                
            }
            catch (Exception exc)
            {
                string s = exc.Message;
            }
            



            // Draw the map and return the image back to client in an HttpResponseMessage. 
            using (Bitmap bitmap = new Bitmap(256, 256))
            {



                HttpResponseMessage msg = new HttpResponseMessage(HttpStatusCode.OK);



                try
                {
                    GdiPlusGeoCanvas geoCanvas = new GdiPlusGeoCanvas();
                    RectangleShape boundingBox = WebApiExtentHelper.GetBoundingBoxForXyz(x, y, z, GeographyUnit.DecimalDegree);
                    geoCanvas.BeginDrawing(bitmap, boundingBox, GeographyUnit.DecimalDegree);
                    layerOverlay.Draw(geoCanvas);
                    geoCanvas.EndDrawing();



                    MemoryStream ms = new MemoryStream();
                    bitmap.Save(ms, ImageFormat.Png);



                    msg.Content = new ByteArrayContent(ms.ToArray());
                    msg.Content.Headers.ContentType = new MediaTypeHeaderValue(“image/png”);
                }
                catch (Exception exc)
                {
                    string s = “”;
                }



                return msg;
            }
        }


The controller is being hit correctly, and there is information in the msg.Content when it is returned to the client. Any ideas? I have been looking at this for the last 5 hours and I can’t find what is wrong.



Regards,

Paul

I have also tried 



var shapeLayer = L.dynamicLayer(getRootPath() + "/edit/{z}/{x}/{y}/" + accessId);



without any luck.



Regards,

Paul

Paul,  
  
 What’s the projection of the Oracle Data? As most data is using a local projection (UTM for example) with the unit of Meter/Feet, in that case nothing would be actually drawn on the map using DecimalDegrees as what in your code now.  
  
 Open Product Center -> WebAPI Edition and launch the GemetricFunctions sample, you would see how to use a meter based projection rather than decimal degrees. You would see on server side, we need to get boundingBox based on meter not Decimal Degrees.  
  
      RectangleShape boundingBox = WebApiExtentHelper.GetBoundingBoxForXyz(x, y, z, GeographyUnit.Meter); 
      geoCanvas.BeginDrawing(bitmap, boundingBox, GeographyUnit.Meter); 
  
 Ben 


The projection is in decimal degrees.  
  
 when I put in the code above, I get the following error: 
  
 “The invoked member is not supported in a dynamic assembly.” 
  
 I’ll go through that sample now. I just wanted to respond quickly because I am in Australia, and with the time difference, this is probably the only time we will both be online. 
  
 Paul 


All right, let me know what you find out.