[fdo-users] SpatialConditionFilter Error

VitecPer per.bjorklund at vitec.se
Fri Oct 9 04:16:01 PDT 2015


Hello, 

I've come across an issue when I am using a SpatialCondition Filter on my
SelectFeature Command towards my oracle database. 
If I dont add the filter everything runs great, but when I add a
SpatailCondition I get the error message "Spatial Context '' not found ". 


Here is how my code works in VB.NET 
***************************** 
Dim connManager as OSGeo.FDO.IConnectionManager =
OSGeo.FDO.ClientServices.FeatureAccessManager.GetConnectionManager() 
Dim conn As OSGeo.FDO.Connections.IConnection =
connManager.CreateConnection("Autodesk.Oracle.3.9") 
conn.ConnectionString =
"Service=Database;Username=Username;Password=Password;Datastore=Data" 
conn.Open() 

Dim selCmdLine As OSGeo.FDO.Commands.Feature.ISelect =
conn.CreateCommand(OSGeo.FDO.Commands.CommandType.CommandType_Select) 
selCmdLine.FeatureClassName = New OSGeo.FDO.Expression.Identifier("VIEW") 

Dim geometryFactory As New OSGeo.FDO.Geometry.FgfGeometryFactory() 
Dim polystring As String = "POLYGON ((148697.589 6585101.768, 148697.589
6585091.695, 148722.198 6585091.695, 148722.198 6585101.768, 148697.589
6585101.768))" 

Dim poly As OSGeo.FDO.Geometry.IPolygon =
CType(geometryFactory.CreateGeometry(polystring),
OSGeo.FDO.Geometry.IPolygon) 

Dim byteArray As Byte() = geometryFactory.GetFgf(poly) 
Dim qryGeomVal As OSGeo.FDO.Expression.GeometryValue = New
OSGeo.FDO.Expression.GeometryValue(byteArray) 

selCmdLine.Filter = New OSGeo.FDO.Filter.SpatialCondition("SHAPE",
OSGeo.FDO.Filter.SpatialOperations.SpatialOperations_Intersects, qryGeomVal) 

Dim ftrRdr As OSGeo.FDO.Commands.Feature.IFeatureReader = selCmd.Execute() 
***************************** 


At the selCmdline.Execute() the exception occures. 

What am I doing wrong? 
or How can I specify the spatial context for the command? 

Thankful for any help. 
// Per



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/SpatialConditionFilter-Error-tp5228975.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list