is there an function for multi condition searching by postgis provider in sharpV2.0

Topics: SharpMap v2.0
Sep 12, 2013 at 5:23 AM
    is ther an funtion for multi condition seaching by postgis provider like  "a>10 and b='name'"?  
Sep 12, 2013 at 6:03 AM
Edited Sep 12, 2013 at 6:04 AM
You can mimic an additional where clause by using PostGis provider's DefinitionQuery property.
Try pgProvider.DefinitionQuery = "a>10 and b='name'";

Hth FObermaier
Sep 12, 2013 at 9:36 AM
thank you for your replay,but I use sourcecode of googlesharpmap V2.0,the DefinitionQuery is an PredicateExpression object using like " ((ISpatialDbProvider)m_provider).DefinitionQuery=PredicateExpression"; It seems that it is different with the sourcecode here. do you know how to use google code to realize multi condition seaching? thanks
Sep 12, 2013 at 11:41 AM
Sorry, I've overread that.

You are aware that SharpMap v2 is no longer maintained?

Anyway, you need to set up a SharpMap.Expressions.ProviderQueryExpression that contains some SharpMap.Expressions.BinaryExpressions.
Sth like
var pqe = new SharpMap.Expressions.ProviderQueryExpression(
    new AllAttributesExpression(),
    new SharpMap.Expressions.BinaryExpression(
            new SharpMap.Expressions.PropertyNameExpression("a"), 
            new SharpMap.Expressions.LiteralExpression<int>(10)),
        new SharpMap.Expressions.BinaryExpression(
            new SharpMap.Expressions.PropertyNameExpression("b"), 
Beautiful, isn't it :)

Hth FObermaier
Sep 13, 2013 at 4:08 AM
         Thank you very much! I will have a try according to what you said. Yes , I know SharpMap v2 is no longer maintained. Howerver, v2 is what I want. :)   SharpMap is an excellent project for me to learn gis.
Sep 13, 2013 at 9:11 AM
wangdun686 wrote:
Howerver, v2 is what I want. :)
Do you mind telling me what explicit feature of v2 you care about?
Sep 16, 2013 at 1:18 AM
There are more providers for me to use like ArcSDE,such as SQLProvider,KML,DB2 and so on. :)