Infrastructure Map Server Developer

Active Member
Posts: 7
Registered: ‎01-08-2010
Message 1 of 2 (283 Views)

filter with OR and SpatialFilter

283 Views, 1 Replies
05-03-2013 02:35 PM

my code does a query based on filter and within the goemetry selected.


If the filter is simple like "TYPE=1", then it works fine, but when Filter contains OR, then it will return all features and ignore the spatial filter.

queryOptions.SetFilter("TYPE=1 OR TYPE = 2")

queryOptions.SetSpatialFilter(geometryField, selectionPoly,



MgFeatureReader fr = this._featureService.SelectFeatures((newMgResourceIdentifier(themeLayer.FeatureSourceId)), themeLayer.GetFeatureClassName(), queryOptions);



the feature provider is


I did another test using sdf based layer and it returned features inside selected geometry on both filter with or without "OR" situations.


Valued Mentor
Posts: 273
Registered: ‎10-06-2008
Message 2 of 2 (272 Views)

Re: filter with OR and SpatialFilter

05-05-2013 07:53 PM in reply to: nick_xu

I think it may be the same problem as this one:


Basically, the FDO provider is not properly wrapping () around the translated non-spatial filter resulting in incorrect operator precedence when combined with a spatial filter.


- Jackie

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community