[fdo-users] How to retrieve the Oracle Spatial Data
Shaik Esu
ShaikEsu at infotechsw.com
Fri Oct 31 08:54:44 EDT 2008
"IFeatureReader FDOReader" is returning null value.
Regards,
Shaik Esu,
Sr Software Engineer,
Infotech Enterprises Ltd,
Extn: 740.
Mobile +91 9849538712.
_____
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Donald Cameron
Sent: Friday, October 31, 2008 6:03 PM
To: 'FDO Users Mail List'
Subject: RE: [fdo-users] How to retrieve the Oracle Spatial Data
What is the error message?
From: fdo-users-bounces at lists.osgeo.org
[mailto:fdo-users-bounces at lists.osgeo.org] On Behalf Of Shaik Esu
Sent: Friday, October 31, 2008 12:04 AM
To: 'FDO Users Mail List'
Subject: [fdo-users] How to retrieve the Oracle Spatial Data
Hi All,
I want to retrieve the Geometry stored in oracle spatial.
I have written the below code
private IProviderRegistry FDORegistry =
FeatureAccessManager.GetProviderRegistry();
private IConnectionManager FDOManager =
FeatureAccessManager.GetConnectionManager();
private IConnection FDOConnection =
FeatureAccessManager.GetConnectionManager().CreateConnection("OSGeo.KingOrac
le.3.3");
public ConnectionState Constate;
string featureclsname;
public FDOKingOracleClass(string username,string password,string
servicename,string featureclassname)
{
FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("Username",
username);
FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("Password",
password);
FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("Service",
servicename);
FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("OracleSchema"
, servicename);
FDOConnection.ConnectionInfo.ConnectionProperties.SetProperty("KingFdoClass"
, featureclassname);
featureclsname = featureclassname;
Constate = FDOConnection.Open();
}
I am able to open the connection without any error. but I could not able to
retrieve the geometry collection.
I am getting the error in below code..
public GeometryCollection SelectAllQuery()
{
GeometryCollection Geo_Collection = new GeometryCollection();
try
{
ISelect sel =
(ISelect)FDOConnection.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandT
ype_Select);
sel.SetFeatureClassName(featureclsname);
// sel.LockType =
OSGeo.FDO.Commands.Locking.LockType.LockType_Unsupported;
IFeatureReader FDOReader = sel.Execute();
FgfGeometryFactory gFac = new FgfGeometryFactory();
while (FDOReader.ReadNext())
{
Byte[] Tmppts = FDOReader.GetGeometry("Geometry");
Geo_Collection.Add(gFac.CreateGeometryFromFgf(Tmppts));
}
}
catch(OSGeo.FDO.Common.Exception ex)
{
MessageBox.Show(ex.Message.ToString());
}
return Geo_Collection;
}
If anybody has the code to retrieve the spatial data, please help me.
Thank You,
Regards,
Shaik Esu,
Sr Software Engineer,
Infotech Enterprises Ltd,
Extn: 740.
Mobile +91 9849538712.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/fdo-users/attachments/20081031/d0d5c311/attachment-0001.html
More information about the fdo-users
mailing list