SpatialConditionFilter Error

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

SpatialConditionFilter Error


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"

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