ThinkGeo.com    |     Documentation    |     Premium Support

LoadAnOracleFeatureLayer

Our data is stored in ArcSDE in Oracle Spatial format so at the moment am trying to connect ThinkGeo to our Oracle database. I tried changing the example "LoadAnOracleFeatureLayer.cs" that came with the setup. So far without any luck. It says it can't resolve the TNS I supplied {"ORA-12154: TNS:could not resolve the connect identifier specified\n"}. The TNS I use is valid and works with other applications.



Maybe you can help?



Lyle, 
  
 Could you tell more about how you connect to the Oracle Server as we can not recreate this issue. 
  
 Thanks, 
 ThinkGeo Support 


private void LoadOracleLayer() 
         { 
             Controls.Clear(); 
             Controls.Add(winformsMap1); 
  
             winformsMap1.MapUnit = GeographyUnit.Meter; 
  
             winformsMap1.CurrentExtent = new RectangleShape(0, 750000,300000,300000); 
             winformsMap1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); 
  
             string connectString = "User ID=uid;Password=pwd;Data Source=tegsist.world;"; 
             OracleFeatureLayer oracleLayer = new OracleFeatureLayer(connectString, "topo25", "objectid"); 
             //oracleLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; 
             //oracleLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; 
  
             winformsMap1.StaticOverlay.Layers.Add("OracleLayer", oracleLayer); 
  
             winformsMap1.Refresh();  
         } 
  
 In this case Tegsist.world is the name of the entry in the tnsnames.ora file

Thanks Ernst-jan, 
  
 We will look into it and let you know the result. 
  
 ThinkGeo Support

Lyle, 
  
   I think I may know what the problem is.  Since you are using ArcSDE the format of the data in Oracle is the custom ArcSDE format which is very different from the native Spatial format Oracle uses.  Our OracleFeatureLayer is designed to access data in a standalone Oracle Spatial table using the Oracle Spatial API.  It is my understanding that ArcSDE has its own table format it uses in Oracle as it supported spatial features way before Oracle introduced Oracle Spatial.  
  
   The solution to this is to use our ArcSDE connector which is currently in limited Alpha right now.  We are working through some issue with it.  Currently we do not have a release data but that is what you will need to access your ArcSDE data regardless of the back-end format. 
  
 David

David, 
  
 As mentioned earlier the data is stored in Oracle Spatial format ( SDO_GEOMETRY) this is an option in ArcSDE 
  
 The error message suggests a problem with the Oracle connection. 
  
 {"ORA-12154: TNS:could not resolve the connect identifier specified\n"}. 
  
 EJ

Ernst-jan, 


Sorry for the delay on our end.
 
We spent some time trying to recreate this issue but failed. Anyway, please check the following items.
 
1, Please download the TempOracleExtension in which we have some bug fixed on the Oracle Layer. This assembly will be integrated in the upcoming public release.
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/5576/afv/topic/Default.aspx
 
2, in a connection string, I think we need both server name and service name for a data source, such as “Data Source=192.168.0.178/orcl” (“orcl” is the service name). I didn't see the server name in your connection string though, maybe that's a reason.
 
3 Just wonder are you using the Oracle Express Edition as we don’t fully support that. If not, could you make sure you are using the correct table name and geometry column name in codes (with the correct cases). And what’s your oracle version, the one we are testing is 11.1g

 
As this exception seems quite common in google and most of them are setting related issues, could you double check your Oracle settings? Maybe that will work.

 
If you still have this problem, can you let me know more how to recreate this issue? It will be great if you can let us know how to build the same data base as yours.
 
Thanks,
 
Ben

Hi, 
 I had the same issue when I tried the sample the first time. To sort it out, I simply created and opened my own oracle connection. After that it works. It seems that the problem is that it expects a connection to be available  in the pool. 
 After that i’m getting: ORA-00936: missing expression when trying to display the layer… 
  
  
 cheers, 
 George

George,


Thanks for your post and welcome you to ThinkGeo Map Suite Desktop Forum!


Following post also talks about the same issue, please take a look if you are interested:

gis.thinkgeo.com/Support/Dis...fault.aspx


Let me know if any more questions!


Thanks.


Yale