This project has moved and is read-only. For the latest updates, please go here.

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

Topics: SharpMap v2.0
Sep 12, 2013 at 6:23 AM
    is ther an funtion for multi condition seaching by postgis provider like  "a>10 and b='name'"?  
Sep 12, 2013 at 7:03 AM
Edited Sep 12, 2013 at 7: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 10: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 12:41 PM
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 5: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 10: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 2:18 AM
There are more providers for me to use like ArcSDE,such as SQLProvider,KML,DB2 and so on. :)